@pyric/cli 0.1.0-alpha.10 → 0.1.0-alpha.11
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.orig +2 -2
- package/dist/assurance/.generated/conformance-verdicts.d.ts +16 -0
- package/dist/assurance/.generated/conformance-verdicts.d.ts.map +1 -1
- package/dist/assurance/.generated/conformance-verdicts.js +16 -0
- package/dist/assurance/.generated/conformance-verdicts.js.map +1 -1
- package/dist/bridge/server/peer.d.ts +1 -1
- package/dist/bridge/server.d.ts +1 -1
- package/dist/bridge/server.js +1 -1
- package/dist/cli/index.d.ts +11 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +13 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init.d.ts +3 -3
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +5 -5
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/serve.d.ts.map +1 -1
- package/dist/cli/serve.js +8 -2
- package/dist/cli/serve.js.map +1 -1
- package/dist/conformance/.generated/can-i-use-browser.d.ts.map +1 -1
- package/dist/conformance/.generated/can-i-use-browser.js +1 -1
- package/dist/conformance/.generated/can-i-use-browser.js.map +1 -1
- package/dist/conformance/.generated/can-i-use.d.ts.map +1 -1
- package/dist/conformance/.generated/can-i-use.js +1 -1
- package/dist/conformance/.generated/can-i-use.js.map +1 -1
- package/dist/conformance/.generated/conformance-docs.d.ts +12 -0
- package/dist/conformance/.generated/conformance-docs.d.ts.map +1 -0
- package/dist/conformance/.generated/conformance-docs.js +2 -0
- package/dist/conformance/.generated/conformance-docs.js.map +1 -0
- package/dist/conformance/docs.d.ts +6 -0
- package/dist/conformance/docs.d.ts.map +1 -0
- package/dist/conformance/docs.js +6 -0
- package/dist/conformance/docs.js.map +1 -0
- package/dist/remote/index.d.ts.map +1 -1
- package/dist/remote/index.js +1 -0
- package/dist/remote/index.js.map +1 -1
- package/dist/serve/activity-guard.d.ts +4 -0
- package/dist/serve/activity-guard.d.ts.map +1 -0
- package/dist/serve/activity-guard.js +22 -0
- package/dist/serve/activity-guard.js.map +1 -0
- package/dist/serve/activity-route.d.ts +4 -0
- package/dist/serve/activity-route.d.ts.map +1 -0
- package/dist/serve/activity-route.js +157 -0
- package/dist/serve/activity-route.js.map +1 -0
- package/dist/serve/activity-warning.d.ts +4 -0
- package/dist/serve/activity-warning.d.ts.map +1 -0
- package/dist/serve/activity-warning.js +21 -0
- package/dist/serve/activity-warning.js.map +1 -0
- package/dist/serve/bridge-mount.d.ts +5 -0
- package/dist/serve/bridge-mount.d.ts.map +1 -1
- package/dist/serve/bridge-mount.js +1 -0
- package/dist/serve/bridge-mount.js.map +1 -1
- package/dist/serve/docs-ui/404.html +3 -0
- package/dist/serve/docs-ui/_astro/{_slug_.DPUwShm2.css → _slug_.CXh9yTP1.css} +1 -1
- package/dist/serve/docs-ui/_astro/_slug_.DUci-duz.css +1 -0
- package/dist/serve/docs-ui/docs/_rhythm/index.html +2 -1
- package/dist/serve/docs-ui/docs/agent/set-up-your-agent/index.html +3 -2
- package/dist/serve/docs-ui/docs/agent/set-up-your-agent.md +1 -1
- package/dist/serve/docs-ui/docs/agent/watch-and-review/index.html +2 -1
- package/dist/serve/docs-ui/docs/agent/work-with-an-agent/index.html +2 -1
- package/dist/serve/docs-ui/docs/ai-compat/index.html +2 -1
- package/dist/serve/docs-ui/docs/api-reference/index.html +51 -49
- package/dist/serve/docs-ui/docs/api-reference.md +2 -2
- package/dist/serve/docs-ui/docs/app-compat/index.html +2 -1
- package/dist/serve/docs-ui/docs/auth-compat/index.html +2 -1
- package/dist/serve/docs-ui/docs/build/ai-logic/index.html +18 -3
- package/dist/serve/docs-ui/docs/build/ai-logic.md +30 -2
- package/dist/serve/docs-ui/docs/build/authentication/index.html +2 -1
- package/dist/serve/docs-ui/docs/build/authentication.md +1 -1
- package/dist/serve/docs-ui/docs/build/cloud-firestore/index.html +2 -1
- package/dist/serve/docs-ui/docs/build/cloud-messaging/index.html +46 -2
- package/dist/serve/docs-ui/docs/build/cloud-messaging.md +56 -1
- package/dist/serve/docs-ui/docs/build/cloud-storage/index.html +2 -1
- package/dist/serve/docs-ui/docs/build/cloud-storage.md +1 -1
- package/dist/serve/docs-ui/docs/build/realtime-database/index.html +21 -3
- package/dist/serve/docs-ui/docs/build/realtime-database.md +25 -1
- package/dist/serve/docs-ui/docs/conformance-scores/index.html +2 -1
- package/dist/serve/docs-ui/docs/create-pyric-reference-api/index.html +61 -28
- package/dist/serve/docs-ui/docs/create-pyric-reference-api.md +65 -20
- package/dist/serve/docs-ui/docs/database-compat/index.html +2 -1
- package/dist/serve/docs-ui/docs/firestore-compat/index.html +6 -5
- package/dist/serve/docs-ui/docs/firestore-compat.md +4 -4
- package/dist/serve/docs-ui/docs/functions-rtdb-compat/index.html +2 -1
- package/dist/serve/docs-ui/docs/get-started/how-the-swap-works/index.html +2 -1
- package/dist/serve/docs-ui/docs/get-started/start-building/index.html +4 -3
- package/dist/serve/docs-ui/docs/get-started/start-building.md +2 -2
- package/dist/serve/docs-ui/docs/index.json +800 -575
- package/dist/serve/docs-ui/docs/messaging-compat/index.html +2 -1
- package/dist/serve/docs-ui/docs/observe/see-whats-happening/index.html +2 -1
- package/dist/serve/docs-ui/docs/observe/shape-your-data/index.html +2 -1
- package/dist/serve/docs-ui/docs/overview/index.html +2 -1
- package/dist/serve/docs-ui/docs/pyric-admin-app-reference-api/index.html +5 -4
- package/dist/serve/docs-ui/docs/pyric-admin-app-reference-api.md +3 -4
- package/dist/serve/docs-ui/docs/pyric-admin-auth-reference-api/index.html +5 -4
- package/dist/serve/docs-ui/docs/pyric-admin-auth-reference-api.md +3 -4
- package/dist/serve/docs-ui/docs/pyric-admin-database-reference-api/index.html +5 -4
- package/dist/serve/docs-ui/docs/pyric-admin-database-reference-api.md +3 -4
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-api/index.html +2503 -12
- package/dist/serve/docs-ui/docs/pyric-admin-firestore-reference-api.md +2219 -8
- package/dist/serve/docs-ui/docs/pyric-admin-storage-reference-api/index.html +4 -3
- package/dist/serve/docs-ui/docs/pyric-admin-storage-reference-api.md +2 -3
- package/dist/serve/docs-ui/docs/pyric-ai-reference-api/index.html +16 -11
- package/dist/serve/docs-ui/docs/pyric-ai-reference-api.md +14 -13
- package/dist/serve/docs-ui/docs/pyric-ai-scripting-reference-api/index.html +4 -3
- package/dist/serve/docs-ui/docs/pyric-ai-scripting-reference-api.md +2 -3
- package/dist/serve/docs-ui/docs/pyric-app-reference-api/index.html +7 -2
- package/dist/serve/docs-ui/docs/pyric-app-reference-api.md +5 -2
- package/dist/serve/docs-ui/docs/pyric-auth-reference-api/index.html +23 -12
- package/dist/serve/docs-ui/docs/pyric-auth-reference-api.md +15 -12
- package/dist/serve/docs-ui/docs/pyric-cli-assurance-browser-reference-api/index.html +10 -48
- package/dist/serve/docs-ui/docs/pyric-cli-assurance-browser-reference-api.md +11 -24
- package/dist/serve/docs-ui/docs/pyric-cli-assurance-reference-api/index.html +87 -97
- package/dist/serve/docs-ui/docs/pyric-cli-assurance-reference-api.md +53 -65
- package/dist/serve/docs-ui/docs/pyric-cli-bridge-client-reference-api/index.html +14 -15
- package/dist/serve/docs-ui/docs/pyric-cli-bridge-client-reference-api.md +19 -28
- package/dist/serve/docs-ui/docs/pyric-cli-bridge-reference-api/index.html +4 -3
- package/dist/serve/docs-ui/docs/pyric-cli-bridge-reference-api.md +2 -3
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-browser-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-browser-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-docs-reference-api/index.html +51 -0
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-docs-reference-api.md +36 -0
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-cli-conformance-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-cli-credentials-node-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-cli-credentials-node-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-cli-discover-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-cli-discover-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-cli-register-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-cli-register-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-cli-remote-reference-api/index.html +1067 -83
- package/dist/serve/docs-ui/docs/pyric-cli-remote-reference-api.md +1291 -160
- package/dist/serve/docs-ui/docs/pyric-cli-serve-worker-reference-api/index.html +123 -92
- package/dist/serve/docs-ui/docs/pyric-cli-serve-worker-reference-api.md +49 -20
- package/dist/serve/docs-ui/docs/pyric-cli-verify-reference-api/index.html +72 -7
- package/dist/serve/docs-ui/docs/pyric-cli-verify-reference-api.md +22 -7
- package/dist/serve/docs-ui/docs/pyric-cli-vite-reference-api/index.html +33 -12
- package/dist/serve/docs-ui/docs/pyric-cli-vite-reference-api.md +15 -12
- package/dist/serve/docs-ui/docs/pyric-database-reference-api/index.html +18 -17
- package/dist/serve/docs-ui/docs/pyric-database-reference-api.md +19 -22
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-api/index.html +1512 -545
- package/dist/serve/docs-ui/docs/pyric-firestore-reference-api.md +1311 -316
- package/dist/serve/docs-ui/docs/pyric-firestore-values-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-firestore-values-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-messaging-reference-api/index.html +5 -4
- package/dist/serve/docs-ui/docs/pyric-messaging-reference-api.md +3 -4
- package/dist/serve/docs-ui/docs/pyric-messaging-sw-reference-api/index.html +69 -369
- package/dist/serve/docs-ui/docs/pyric-messaging-sw-reference-api.md +103 -216
- package/dist/serve/docs-ui/docs/pyric-rules-reference-api/index.html +10 -9
- package/dist/serve/docs-ui/docs/pyric-rules-reference-api.md +9 -10
- package/dist/serve/docs-ui/docs/pyric-sandbox-database-reference-api/index.html +8 -7
- package/dist/serve/docs-ui/docs/pyric-sandbox-database-reference-api.md +6 -7
- package/dist/serve/docs-ui/docs/pyric-sandbox-firestore-reference-api/index.html +10 -9
- package/dist/serve/docs-ui/docs/pyric-sandbox-firestore-reference-api.md +9 -10
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-api/index.html +374 -910
- package/dist/serve/docs-ui/docs/pyric-sandbox-reference-api.md +377 -911
- package/dist/serve/docs-ui/docs/pyric-storage-reference-api/index.html +25 -17
- package/dist/serve/docs-ui/docs/pyric-storage-reference-api.md +21 -19
- package/dist/serve/docs-ui/docs/pyric-ui-agents-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-ui-agents-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-ui-auth-hooks-reference-api/index.html +63 -776
- package/dist/serve/docs-ui/docs/pyric-ui-auth-hooks-reference-api.md +69 -510
- package/dist/serve/docs-ui/docs/pyric-ui-auth-reference-api/index.html +22 -21
- package/dist/serve/docs-ui/docs/pyric-ui-auth-reference-api.md +29 -30
- package/dist/serve/docs-ui/docs/pyric-ui-events-hooks-reference-api/index.html +15 -168
- package/dist/serve/docs-ui/docs/pyric-ui-events-hooks-reference-api.md +17 -87
- package/dist/serve/docs-ui/docs/pyric-ui-events-reference-api/index.html +6 -5
- package/dist/serve/docs-ui/docs/pyric-ui-events-reference-api.md +5 -6
- package/dist/serve/docs-ui/docs/pyric-ui-firestore-hooks-reference-api/index.html +82 -970
- package/dist/serve/docs-ui/docs/pyric-ui-firestore-hooks-reference-api.md +104 -479
- package/dist/serve/docs-ui/docs/pyric-ui-firestore-reference-api/index.html +30 -29
- package/dist/serve/docs-ui/docs/pyric-ui-firestore-reference-api.md +54 -55
- package/dist/serve/docs-ui/docs/pyric-ui-primitives-reference-api/index.html +3 -2
- package/dist/serve/docs-ui/docs/pyric-ui-primitives-reference-api.md +1 -2
- package/dist/serve/docs-ui/docs/pyric-ui-rtdb-reference-api/index.html +5 -4
- package/dist/serve/docs-ui/docs/pyric-ui-rtdb-reference-api.md +3 -4
- package/dist/serve/docs-ui/docs/pyric-ui-rules-hooks-reference-api/index.html +9 -124
- package/dist/serve/docs-ui/docs/pyric-ui-rules-hooks-reference-api.md +7 -58
- package/dist/serve/docs-ui/docs/pyric-ui-rules-reference-api/index.html +24 -23
- package/dist/serve/docs-ui/docs/pyric-ui-rules-reference-api.md +31 -34
- package/dist/serve/docs-ui/docs/pyric-ui-storage-hooks-reference-api/index.html +104 -1385
- package/dist/serve/docs-ui/docs/pyric-ui-storage-hooks-reference-api.md +133 -817
- package/dist/serve/docs-ui/docs/pyric-ui-storage-reference-api/index.html +34 -33
- package/dist/serve/docs-ui/docs/pyric-ui-storage-reference-api.md +37 -38
- package/dist/serve/docs-ui/docs/pyric-ui-traffic-hooks-reference-api/index.html +116 -1169
- package/dist/serve/docs-ui/docs/pyric-ui-traffic-hooks-reference-api.md +142 -590
- package/dist/serve/docs-ui/docs/pyric-ui-traffic-reference-api/index.html +4 -3
- package/dist/serve/docs-ui/docs/pyric-ui-traffic-reference-api.md +3 -4
- package/dist/serve/docs-ui/docs/rules-compat/index.html +34 -1
- package/dist/serve/docs-ui/docs/rules-compat.md +32 -0
- package/dist/serve/docs-ui/docs/secure/audit-your-rules/index.html +19 -2
- package/dist/serve/docs-ui/docs/secure/audit-your-rules.md +32 -0
- package/dist/serve/docs-ui/docs/secure/firestore-rules-limits/index.html +2 -1
- package/dist/serve/docs-ui/docs/secure/read-a-denial/index.html +2 -1
- package/dist/serve/docs-ui/docs/secure/rtdb-rules-in-typescript/index.html +2 -1
- package/dist/serve/docs-ui/docs/secure/rtdb-rules-in-typescript.md +1 -1
- package/dist/serve/docs-ui/docs/secure/rules-standard-library/index.html +2 -1
- package/dist/serve/docs-ui/docs/secure/secure-it-with-rules/index.html +2 -1
- package/dist/serve/docs-ui/docs/secure/simulate-and-lint/index.html +2 -1
- package/dist/serve/docs-ui/docs/secure/write-a-rules-test-suite/index.html +2 -1
- package/dist/serve/docs-ui/docs/ship/ship-to-production/index.html +2 -1
- package/dist/serve/docs-ui/docs/ship/test-in-node/index.html +2 -1
- package/dist/serve/docs-ui/docs/storage-compat/index.html +2 -1
- package/dist/serve/docs-ui/docs/trust/how-we-know-it-matches-firebase/index.html +2 -1
- package/dist/serve/docs-ui/docs/trust/versioning-and-compatibility/index.html +2 -1
- package/dist/serve/docs-ui/llms.txt +1 -0
- package/dist/serve/entries/ai.d.ts.map +1 -1
- package/dist/serve/entries/ai.js +39 -1
- package/dist/serve/entries/ai.js.map +1 -1
- package/dist/serve/entries/messaging-sw.d.ts.map +1 -1
- package/dist/serve/entries/messaging-sw.js +5 -1
- package/dist/serve/entries/messaging-sw.js.map +1 -1
- package/dist/serve/entries/messaging.d.ts.map +1 -1
- package/dist/serve/entries/messaging.js +7 -1
- package/dist/serve/entries/messaging.js.map +1 -1
- package/dist/serve/entries/runtime.d.ts.map +1 -1
- package/dist/serve/entries/runtime.js +20 -1
- package/dist/serve/entries/runtime.js.map +1 -1
- package/dist/serve/init-payload.d.ts +25 -0
- package/dist/serve/init-payload.d.ts.map +1 -1
- package/dist/serve/namespace.d.ts +39 -0
- package/dist/serve/namespace.d.ts.map +1 -1
- package/dist/serve/namespace.js +80 -1
- package/dist/serve/namespace.js.map +1 -1
- package/dist/serve/standalone-assets.d.ts +11 -9
- package/dist/serve/standalone-assets.d.ts.map +1 -1
- package/dist/serve/standalone-assets.js +6 -5
- package/dist/serve/standalone-assets.js.map +1 -1
- package/dist/serve/studio-ui/assets/{RulesCodeEditor-CXdSLKhO.js → RulesCodeEditor-CxVYcZXw.js} +1 -1
- package/dist/serve/studio-ui/assets/index-cpSfgQ7H.js +1218 -0
- package/dist/serve/studio-ui/assets/seed-DeuFKi4J.js +20 -0
- package/dist/serve/studio-ui/index.html +1 -1
- package/dist/serve/vite-plugin.d.ts +92 -15
- package/dist/serve/vite-plugin.d.ts.map +1 -1
- package/dist/serve/vite-plugin.js +281 -11
- package/dist/serve/vite-plugin.js.map +1 -1
- package/dist/serve/worker/activity-bootstrap.d.ts +8 -0
- package/dist/serve/worker/activity-bootstrap.d.ts.map +1 -0
- package/dist/serve/worker/activity-bootstrap.js +11 -0
- package/dist/serve/worker/activity-bootstrap.js.map +1 -0
- package/dist/serve/worker/client/connection.d.ts.map +1 -1
- package/dist/serve/worker/client/connection.js +17 -5
- package/dist/serve/worker/client/connection.js.map +1 -1
- package/dist/serve/worker/client/core.d.ts +2 -2
- package/dist/serve/worker/client/core.d.ts.map +1 -1
- package/dist/serve/worker/client/core.js +33 -5
- package/dist/serve/worker/client/core.js.map +1 -1
- package/dist/serve/worker/client/firestore-writes.d.ts.map +1 -1
- package/dist/serve/worker/client/firestore-writes.js +1 -0
- package/dist/serve/worker/client/firestore-writes.js.map +1 -1
- package/dist/serve/worker/client/messaging.d.ts +9 -1
- package/dist/serve/worker/client/messaging.d.ts.map +1 -1
- package/dist/serve/worker/client/messaging.js +15 -0
- package/dist/serve/worker/client/messaging.js.map +1 -1
- package/dist/serve/worker/client/studio.d.ts +10 -0
- package/dist/serve/worker/client/studio.d.ts.map +1 -1
- package/dist/serve/worker/client/studio.js +11 -0
- package/dist/serve/worker/client/studio.js.map +1 -1
- package/dist/serve/worker/durable-persistence.d.ts +12 -0
- package/dist/serve/worker/durable-persistence.d.ts.map +1 -0
- package/dist/serve/worker/durable-persistence.js +118 -0
- package/dist/serve/worker/durable-persistence.js.map +1 -0
- package/dist/serve/worker/entry.d.ts +7 -3
- package/dist/serve/worker/entry.d.ts.map +1 -1
- package/dist/serve/worker/entry.js +7 -3
- package/dist/serve/worker/entry.js.map +1 -1
- package/dist/serve/worker/host/core.d.ts +9 -5
- package/dist/serve/worker/host/core.d.ts.map +1 -1
- package/dist/serve/worker/host/core.js +33 -8
- package/dist/serve/worker/host/core.js.map +1 -1
- package/dist/serve/worker/host/dispatch.d.ts.map +1 -1
- package/dist/serve/worker/host/dispatch.js +9 -2
- package/dist/serve/worker/host/dispatch.js.map +1 -1
- package/dist/serve/worker/host/studio.d.ts +1 -1
- package/dist/serve/worker/host/studio.d.ts.map +1 -1
- package/dist/serve/worker/host/studio.js +36 -1
- package/dist/serve/worker/host/studio.js.map +1 -1
- package/dist/serve/worker/host/subscriptions.d.ts.map +1 -1
- package/dist/serve/worker/host/subscriptions.js +27 -7
- package/dist/serve/worker/host/subscriptions.js.map +1 -1
- package/dist/serve/worker/host-context.d.ts +15 -0
- package/dist/serve/worker/host-context.d.ts.map +1 -1
- package/dist/serve/worker/host-context.js +10 -0
- package/dist/serve/worker/host-context.js.map +1 -1
- package/dist/serve/worker/host-messaging.d.ts.map +1 -1
- package/dist/serve/worker/host-messaging.js +9 -2
- package/dist/serve/worker/host-messaging.js.map +1 -1
- package/dist/serve/worker/index.d.ts +1 -1
- package/dist/serve/worker/index.d.ts.map +1 -1
- package/dist/serve/worker/index.js +2 -0
- package/dist/serve/worker/index.js.map +1 -1
- package/dist/serve/worker/protocol.d.ts +25 -3
- package/dist/serve/worker/protocol.d.ts.map +1 -1
- package/dist/serve/worker/protocol.js.map +1 -1
- package/dist/serve/worker/serve-init.d.ts +23 -37
- package/dist/serve/worker/serve-init.d.ts.map +1 -1
- package/dist/serve/worker/serve-init.js +95 -172
- package/dist/serve/worker/serve-init.js.map +1 -1
- package/dist/vite.d.ts +4 -4
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +3 -3
- package/dist/vite.js.map +1 -1
- package/package.json +8 -4
- package/dist/serve/studio-ui/assets/index-BvtQIpGn.js +0 -1211
- package/dist/serve/studio-ui/assets/seed-3DMedLL3.js +0 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>API reference: pyric/firestore · Pyric Studio</title><meta name="description" content="Published declarations for pyric/firestore."><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet"><link rel="stylesheet" href="/__pyric/ui/_astro/_slug_.DPUwShm2.css"></head> <body> <header class="studio__bar"> <div class="studio__bar-inner"> <a class="studio__brand" href="/__pyric/ui/" aria-label="Pyric Studio">Pyric</a> <nav class="studio__nav" aria-label="Studio tabs"> <a class="studio__nav-tab" href="/__pyric/ui/"> Home </a><a class="studio__nav-tab" href="/__pyric/ui/firestore"> Firestore </a><a class="studio__nav-tab" href="/__pyric/ui/auth"> Auth </a><a class="studio__nav-tab" href="/__pyric/ui/rtdb"> RTDB </a><a class="studio__nav-tab" href="/__pyric/ui/storage"> Storage </a><a class="studio__nav-tab" href="/__pyric/ui/traffic"> Traffic </a><a class="studio__nav-tab" href="/__pyric/ui/settings"> Settings </a><a class="studio__nav-tab" href="/__pyric/ui/docs" aria-current="page"> Docs </a> </nav> </div> </header> <div class="docs-shell"> <details class="docs-nav-drawer"> <summary>Navigate</summary> <nav class="docs-nav" aria-label="Documentation"> <div class="docs-search" data-index-url="/__pyric/ui/docs/index.json"> <div class="docs-search-field"> <svg class="docs-search-icon" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"> <path d="M11.5 11.5 15 15M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> <input type="text" class="docs-search-input" placeholder="Search docs" aria-label="Search docs" autocomplete="off" spellcheck="false"> <kbd class="docs-search-kbd">⌘K</kbd> </div> <ul class="docs-search-results" hidden></ul> </div> <script type="module">let i=null;function d(t){return i||(i=fetch(t).then(e=>e.json())),i}function l(t,e){return t.title.toLowerCase().includes(e)||t.excerpt.toLowerCase().includes(e)?!0:t.headings.some(r=>r.text.toLowerCase().includes(e))}function u(t,e,r){if(e.innerHTML="",t.length===0){e.hidden=!1;{const n=document.createElement("li");n.className="docs-search-empty",n.textContent="No matches",e.appendChild(n)}return}e.hidden=!1;for(const n of t.slice(0,8)){const s=document.createElement("li"),c=document.createElement("a");c.href=n.path;const o=document.createElement("span");o.className="docs-search-result-title",o.textContent=n.title;const a=document.createElement("span");a.className="docs-search-result-meta",a.textContent=[n.group,n.section].filter(Boolean).join(" / "),c.append(o,a),s.appendChild(c),e.appendChild(s)}}document.querySelectorAll(".docs-search").forEach(t=>{const e=t.dataset.indexUrl,r=t.querySelector(".docs-search-input"),n=t.querySelector(".docs-search-results");r.addEventListener("input",async()=>{const s=r.value.trim().toLowerCase();if(!s){n.hidden=!0,n.innerHTML="";return}const{pages:c}=await d(e);r.value.trim().toLowerCase()===s&&u(c.filter(o=>l(o,s)),n)}),r.addEventListener("focus",()=>{d(e),n.childElementCount>0&&(n.hidden=!1)}),r.addEventListener("keydown",s=>{s.key==="Escape"&&(r.value="",n.hidden=!0,n.innerHTML="",r.blur())}),r.addEventListener("blur",()=>{window.setTimeout(()=>{n.hidden=!0},150)})});document.addEventListener("keydown",t=>{if(!(t.metaKey||t.ctrlKey)||t.key.toLowerCase()!=="k")return;const e=[...document.querySelectorAll(".docs-search-input")].find(r=>r.offsetParent!==null);e&&(t.preventDefault(),e.focus(),e.select())});</script> <a class="docs-nav-toplink" href="/__pyric/ui/docs/overview/"> Overview </a><details class="docs-nav-group"> <summary>Get started</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/get-started/start-building/"> Quickstart </a> </li><li> <a href="/__pyric/ui/docs/get-started/how-the-swap-works/"> How the swap works </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Build</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/build/authentication/"> Authentication </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-firestore/"> Cloud Firestore </a> </li><li> <a href="/__pyric/ui/docs/build/realtime-database/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-storage/"> Cloud Storage </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-messaging/"> Cloud Messaging </a> </li><li> <a href="/__pyric/ui/docs/build/ai-logic/"> AI Logic </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Secure & debug</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/secure/secure-it-with-rules/"> Security Rules </a> </li><li> <a href="/__pyric/ui/docs/secure/simulate-and-lint/"> Simulate and lint before you deploy </a> </li><li> <a href="/__pyric/ui/docs/secure/write-a-rules-test-suite/"> Write a rules test suite </a> </li><li> <a href="/__pyric/ui/docs/secure/read-a-denial/"> Read a denial and understand it </a> </li><li> <a href="/__pyric/ui/docs/secure/rules-standard-library/"> The rules standard library </a> </li><li> <a href="/__pyric/ui/docs/secure/rtdb-rules-in-typescript/"> RTDB rules in TypeScript </a> </li><li> <a href="/__pyric/ui/docs/secure/firestore-rules-limits/"> Rules limits </a> </li><li> <a href="/__pyric/ui/docs/secure/audit-your-rules/"> Audit rules and data </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Observe & shape</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/observe/see-whats-happening/"> Traffic & rule verdicts </a> </li><li> <a href="/__pyric/ui/docs/observe/shape-your-data/"> Seed, snapshot, replay </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Ship & test</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/ship/ship-to-production/"> Ship to production </a> </li><li> <a href="/__pyric/ui/docs/ship/test-in-node/"> Test in Node </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Work with an agent</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/agent/set-up-your-agent/"> Connect an agent </a> </li><li> <a href="/__pyric/ui/docs/agent/work-with-an-agent/"> Use the MCP tools </a> </li><li> <a href="/__pyric/ui/docs/agent/watch-and-review/"> Watch in Pyric Studio </a> </li> </ul> </div> </div> </details><a class="docs-nav-toplink" href="/__pyric/ui/docs/trust/versioning-and-compatibility/"> Trust </a><details class="docs-nav-group"> <summary>Conformance</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/conformance-scores/"> Public API coverage </a> </li><li> <a href="/__pyric/ui/docs/trust/how-we-know-it-matches-firebase/"> How we know it matches Firebase </a> </li><li> <a href="/__pyric/ui/docs/app-compat/"> App </a> </li><li> <a href="/__pyric/ui/docs/ai-compat/"> AI Logic </a> </li><li> <a href="/__pyric/ui/docs/auth-compat/"> Auth </a> </li><li> <a href="/__pyric/ui/docs/firestore-compat/"> Firestore </a> </li><li> <a href="/__pyric/ui/docs/database-compat/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/storage-compat/"> Storage </a> </li><li> <a href="/__pyric/ui/docs/messaging-compat/"> Messaging </a> </li><li> <a href="/__pyric/ui/docs/functions-rtdb-compat/"> Functions · RTDB </a> </li><li> <a href="/__pyric/ui/docs/rules-compat/"> Rules </a> </li> </ul> </div> </div> </details> <details class="docs-nav-group" open> <summary>Reference</summary> <div class="docs-nav-group-body docs-nav-group-body--reference"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/api-reference/"> API reference </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-app-reference-api/"> pyric/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-reference-api/" aria-current="page"> pyric/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth-reference-api/"> pyric/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-reference-api/"> pyric/ai </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-scripting-reference-api/"> pyric/ai/scripting </a> </li><li> <a href="/__pyric/ui/docs/pyric-database-reference-api/"> pyric/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage-reference-api/"> pyric/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-reference-api/"> pyric/messaging </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-sw-reference-api/"> pyric/messaging/sw </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules-reference-api/"> pyric/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-values-reference-api/"> pyric/firestore-values </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-reference-api/"> pyric/sandbox </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-firestore-reference-api/"> pyric/sandbox/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-database-reference-api/"> pyric/sandbox/database </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric-admin</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-admin-app-reference-api/"> pyric-admin/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-firestore-reference-api/"> pyric-admin/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-auth-reference-api/"> pyric-admin/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-database-reference-api/"> pyric-admin/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-storage-reference-api/"> pyric-admin/storage </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">create-pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/create-pyric-reference-api/"> create-pyric </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/cli</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli-credentials-node-reference-api/"> @pyric/cli/credentials/node </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-verify-reference-api/"> @pyric/cli/verify </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-reference-api/"> @pyric/cli/conformance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-browser-reference-api/"> @pyric/cli/conformance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-reference-api/"> @pyric/cli/assurance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-browser-reference-api/"> @pyric/cli/assurance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-reference-api/"> @pyric/cli/bridge </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-client-reference-api/"> @pyric/cli/bridge/client </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-discover-reference-api/"> @pyric/cli/discover </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-vite-reference-api/"> @pyric/cli/vite </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-serve-worker-reference-api/"> @pyric/cli/serve/worker </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-remote-reference-api/"> @pyric/cli/remote </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-register-reference-api/"> @pyric/cli/register </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/ui</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-ui-auth-reference-api/"> @pyric/ui/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-auth-hooks-reference-api/"> @pyric/ui/auth/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-primitives-reference-api/"> @pyric/ui/primitives </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-reference-api/"> @pyric/ui/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-hooks-reference-api/"> @pyric/ui/firestore/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rtdb-reference-api/"> @pyric/ui/rtdb </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-reference-api/"> @pyric/ui/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-hooks-reference-api/"> @pyric/ui/storage/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-reference-api/"> @pyric/ui/traffic </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-hooks-reference-api/"> @pyric/ui/traffic/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-reference-api/"> @pyric/ui/events </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-hooks-reference-api/"> @pyric/ui/events/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-agents-reference-api/"> @pyric/ui/agents </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-reference-api/"> @pyric/ui/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-hooks-reference-api/"> @pyric/ui/rules/hooks </a> </li> </ul> </div> </div> </details> </nav> </details> <nav class="docs-nav" aria-label="Documentation"> <div class="docs-search" data-index-url="/__pyric/ui/docs/index.json"> <div class="docs-search-field"> <svg class="docs-search-icon" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"> <path d="M11.5 11.5 15 15M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> <input type="text" class="docs-search-input" placeholder="Search docs" aria-label="Search docs" autocomplete="off" spellcheck="false"> <kbd class="docs-search-kbd">⌘K</kbd> </div> <ul class="docs-search-results" hidden></ul> </div> <a class="docs-nav-toplink" href="/__pyric/ui/docs/overview/" id="nav-group-overview"> Overview </a><details class="docs-nav-group" id="nav-group-get-started"> <summary>Get started</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/get-started/start-building/"> Quickstart </a> </li><li> <a href="/__pyric/ui/docs/get-started/how-the-swap-works/"> How the swap works </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-build"> <summary>Build</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/build/authentication/"> Authentication </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-firestore/"> Cloud Firestore </a> </li><li> <a href="/__pyric/ui/docs/build/realtime-database/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-storage/"> Cloud Storage </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-messaging/"> Cloud Messaging </a> </li><li> <a href="/__pyric/ui/docs/build/ai-logic/"> AI Logic </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-secure-debug"> <summary>Secure & debug</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/secure/secure-it-with-rules/"> Security Rules </a> </li><li> <a href="/__pyric/ui/docs/secure/simulate-and-lint/"> Simulate and lint before you deploy </a> </li><li> <a href="/__pyric/ui/docs/secure/write-a-rules-test-suite/"> Write a rules test suite </a> </li><li> <a href="/__pyric/ui/docs/secure/read-a-denial/"> Read a denial and understand it </a> </li><li> <a href="/__pyric/ui/docs/secure/rules-standard-library/"> The rules standard library </a> </li><li> <a href="/__pyric/ui/docs/secure/rtdb-rules-in-typescript/"> RTDB rules in TypeScript </a> </li><li> <a href="/__pyric/ui/docs/secure/firestore-rules-limits/"> Rules limits </a> </li><li> <a href="/__pyric/ui/docs/secure/audit-your-rules/"> Audit rules and data </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-observe-shape"> <summary>Observe & shape</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/observe/see-whats-happening/"> Traffic & rule verdicts </a> </li><li> <a href="/__pyric/ui/docs/observe/shape-your-data/"> Seed, snapshot, replay </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-ship-test"> <summary>Ship & test</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/ship/ship-to-production/"> Ship to production </a> </li><li> <a href="/__pyric/ui/docs/ship/test-in-node/"> Test in Node </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-work-with-an-agent"> <summary>Work with an agent</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/agent/set-up-your-agent/"> Connect an agent </a> </li><li> <a href="/__pyric/ui/docs/agent/work-with-an-agent/"> Use the MCP tools </a> </li><li> <a href="/__pyric/ui/docs/agent/watch-and-review/"> Watch in Pyric Studio </a> </li> </ul> </div> </div> </details><a class="docs-nav-toplink" href="/__pyric/ui/docs/trust/versioning-and-compatibility/" id="nav-group-trust"> Trust </a><details class="docs-nav-group" id="nav-group-conformance"> <summary>Conformance</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/conformance-scores/"> Public API coverage </a> </li><li> <a href="/__pyric/ui/docs/trust/how-we-know-it-matches-firebase/"> How we know it matches Firebase </a> </li><li> <a href="/__pyric/ui/docs/app-compat/"> App </a> </li><li> <a href="/__pyric/ui/docs/ai-compat/"> AI Logic </a> </li><li> <a href="/__pyric/ui/docs/auth-compat/"> Auth </a> </li><li> <a href="/__pyric/ui/docs/firestore-compat/"> Firestore </a> </li><li> <a href="/__pyric/ui/docs/database-compat/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/storage-compat/"> Storage </a> </li><li> <a href="/__pyric/ui/docs/messaging-compat/"> Messaging </a> </li><li> <a href="/__pyric/ui/docs/functions-rtdb-compat/"> Functions · RTDB </a> </li><li> <a href="/__pyric/ui/docs/rules-compat/"> Rules </a> </li> </ul> </div> </div> </details> <details class="docs-nav-group" id="nav-group-reference" open> <summary>Reference</summary> <div class="docs-nav-group-body docs-nav-group-body--reference"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/api-reference/"> API reference </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-app-reference-api/"> pyric/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-reference-api/" aria-current="page"> pyric/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth-reference-api/"> pyric/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-reference-api/"> pyric/ai </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-scripting-reference-api/"> pyric/ai/scripting </a> </li><li> <a href="/__pyric/ui/docs/pyric-database-reference-api/"> pyric/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage-reference-api/"> pyric/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-reference-api/"> pyric/messaging </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-sw-reference-api/"> pyric/messaging/sw </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules-reference-api/"> pyric/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-values-reference-api/"> pyric/firestore-values </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-reference-api/"> pyric/sandbox </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-firestore-reference-api/"> pyric/sandbox/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-database-reference-api/"> pyric/sandbox/database </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric-admin</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-admin-app-reference-api/"> pyric-admin/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-firestore-reference-api/"> pyric-admin/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-auth-reference-api/"> pyric-admin/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-database-reference-api/"> pyric-admin/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-storage-reference-api/"> pyric-admin/storage </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">create-pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/create-pyric-reference-api/"> create-pyric </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/cli</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli-credentials-node-reference-api/"> @pyric/cli/credentials/node </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-verify-reference-api/"> @pyric/cli/verify </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-reference-api/"> @pyric/cli/conformance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-browser-reference-api/"> @pyric/cli/conformance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-reference-api/"> @pyric/cli/assurance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-browser-reference-api/"> @pyric/cli/assurance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-reference-api/"> @pyric/cli/bridge </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-client-reference-api/"> @pyric/cli/bridge/client </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-discover-reference-api/"> @pyric/cli/discover </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-vite-reference-api/"> @pyric/cli/vite </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-serve-worker-reference-api/"> @pyric/cli/serve/worker </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-remote-reference-api/"> @pyric/cli/remote </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-register-reference-api/"> @pyric/cli/register </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/ui</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-ui-auth-reference-api/"> @pyric/ui/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-auth-hooks-reference-api/"> @pyric/ui/auth/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-primitives-reference-api/"> @pyric/ui/primitives </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-reference-api/"> @pyric/ui/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-hooks-reference-api/"> @pyric/ui/firestore/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rtdb-reference-api/"> @pyric/ui/rtdb </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-reference-api/"> @pyric/ui/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-hooks-reference-api/"> @pyric/ui/storage/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-reference-api/"> @pyric/ui/traffic </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-hooks-reference-api/"> @pyric/ui/traffic/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-reference-api/"> @pyric/ui/events </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-hooks-reference-api/"> @pyric/ui/events/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-agents-reference-api/"> @pyric/ui/agents </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-reference-api/"> @pyric/ui/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-hooks-reference-api/"> @pyric/ui/rules/hooks </a> </li> </ul> </div> </div> </details> </nav> <main class="doc-main"> <nav class="docs-breadcrumbs" aria-label="Breadcrumb"> <ol> <li> <a href="/__pyric/ui/docs/api-reference/">API reference</a> </li><li> <span class="docs-breadcrumbs-sep" aria-hidden="true">/</span> <span>pyric</span> </li><li> <span class="docs-breadcrumbs-sep" aria-hidden="true">/</span> <span aria-current="page">pyric/firestore</span> </li> </ol> </nav> <header class="api-reference-header"> <p class="api-reference-kicker">API reference</p> <h1><code>pyric/firestore</code></h1> <p class="api-reference-meta"> 110 published symbols from <code>pyric</code> </p> <p class="api-reference-source">
|
|
1
|
+
<!DOCTYPE html><html lang="en"> <head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>API reference: pyric/firestore · Pyric Studio</title><meta name="description" content="Published declarations for pyric/firestore."><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet"><link rel="stylesheet" href="/__pyric/ui/_astro/_slug_.CXh9yTP1.css">
|
|
2
|
+
<link rel="stylesheet" href="/__pyric/ui/_astro/_slug_.DUci-duz.css"></head> <body> <header class="studio__bar"> <div class="studio__bar-inner"> <a class="studio__brand" href="/__pyric/ui/" aria-label="Pyric Studio">Pyric</a> <nav class="studio__nav" aria-label="Studio tabs"> <a class="studio__nav-tab" href="/__pyric/ui/"> Home </a><a class="studio__nav-tab" href="/__pyric/ui/firestore"> Firestore </a><a class="studio__nav-tab" href="/__pyric/ui/auth"> Auth </a><a class="studio__nav-tab" href="/__pyric/ui/rtdb"> RTDB </a><a class="studio__nav-tab" href="/__pyric/ui/storage"> Storage </a><a class="studio__nav-tab" href="/__pyric/ui/traffic"> Traffic </a><a class="studio__nav-tab" href="/__pyric/ui/settings"> Settings </a><a class="studio__nav-tab" href="/__pyric/ui/docs" aria-current="page"> Docs </a> </nav> </div> </header> <div class="docs-shell"> <details class="docs-nav-drawer"> <summary>Navigate</summary> <nav class="docs-nav" aria-label="Documentation"> <div class="docs-search" data-index-url="/__pyric/ui/docs/index.json"> <div class="docs-search-field"> <svg class="docs-search-icon" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"> <path d="M11.5 11.5 15 15M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> <input type="text" class="docs-search-input" placeholder="Search docs" aria-label="Search docs" autocomplete="off" spellcheck="false"> <kbd class="docs-search-kbd">⌘K</kbd> </div> <ul class="docs-search-results" hidden></ul> </div> <script type="module">let i=null;function d(t){return i||(i=fetch(t).then(e=>e.json())),i}function l(t,e){return t.title.toLowerCase().includes(e)||t.excerpt.toLowerCase().includes(e)?!0:t.headings.some(r=>r.text.toLowerCase().includes(e))}function u(t,e,r){if(e.innerHTML="",t.length===0){e.hidden=!1;{const n=document.createElement("li");n.className="docs-search-empty",n.textContent="No matches",e.appendChild(n)}return}e.hidden=!1;for(const n of t.slice(0,8)){const s=document.createElement("li"),c=document.createElement("a");c.href=n.path;const o=document.createElement("span");o.className="docs-search-result-title",o.textContent=n.title;const a=document.createElement("span");a.className="docs-search-result-meta",a.textContent=[n.group,n.section].filter(Boolean).join(" / "),c.append(o,a),s.appendChild(c),e.appendChild(s)}}document.querySelectorAll(".docs-search").forEach(t=>{const e=t.dataset.indexUrl,r=t.querySelector(".docs-search-input"),n=t.querySelector(".docs-search-results");r.addEventListener("input",async()=>{const s=r.value.trim().toLowerCase();if(!s){n.hidden=!0,n.innerHTML="";return}const{pages:c}=await d(e);r.value.trim().toLowerCase()===s&&u(c.filter(o=>l(o,s)),n)}),r.addEventListener("focus",()=>{d(e),n.childElementCount>0&&(n.hidden=!1)}),r.addEventListener("keydown",s=>{s.key==="Escape"&&(r.value="",n.hidden=!0,n.innerHTML="",r.blur())}),r.addEventListener("blur",()=>{window.setTimeout(()=>{n.hidden=!0},150)})});document.addEventListener("keydown",t=>{if(!(t.metaKey||t.ctrlKey)||t.key.toLowerCase()!=="k")return;const e=[...document.querySelectorAll(".docs-search-input")].find(r=>r.offsetParent!==null);e&&(t.preventDefault(),e.focus(),e.select())});</script> <a class="docs-nav-toplink" href="/__pyric/ui/docs/overview/"> Overview </a><details class="docs-nav-group"> <summary>Get started</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/get-started/start-building/"> Quickstart </a> </li><li> <a href="/__pyric/ui/docs/get-started/how-the-swap-works/"> How the swap works </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Build</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/build/authentication/"> Authentication </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-firestore/"> Cloud Firestore </a> </li><li> <a href="/__pyric/ui/docs/build/realtime-database/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-storage/"> Cloud Storage </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-messaging/"> Cloud Messaging </a> </li><li> <a href="/__pyric/ui/docs/build/ai-logic/"> AI Logic </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Secure & debug</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/secure/secure-it-with-rules/"> Security Rules </a> </li><li> <a href="/__pyric/ui/docs/secure/simulate-and-lint/"> Simulate and lint before you deploy </a> </li><li> <a href="/__pyric/ui/docs/secure/write-a-rules-test-suite/"> Write a rules test suite </a> </li><li> <a href="/__pyric/ui/docs/secure/read-a-denial/"> Read a denial and understand it </a> </li><li> <a href="/__pyric/ui/docs/secure/rules-standard-library/"> The rules standard library </a> </li><li> <a href="/__pyric/ui/docs/secure/rtdb-rules-in-typescript/"> RTDB rules in TypeScript </a> </li><li> <a href="/__pyric/ui/docs/secure/firestore-rules-limits/"> Rules limits </a> </li><li> <a href="/__pyric/ui/docs/secure/audit-your-rules/"> Audit rules and data </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Observe & shape</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/observe/see-whats-happening/"> Traffic & rule verdicts </a> </li><li> <a href="/__pyric/ui/docs/observe/shape-your-data/"> Seed, snapshot, replay </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Ship & test</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/ship/ship-to-production/"> Ship to production </a> </li><li> <a href="/__pyric/ui/docs/ship/test-in-node/"> Test in Node </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Work with an agent</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/agent/set-up-your-agent/"> Connect an agent </a> </li><li> <a href="/__pyric/ui/docs/agent/work-with-an-agent/"> Use the MCP tools </a> </li><li> <a href="/__pyric/ui/docs/agent/watch-and-review/"> Watch in Pyric Studio </a> </li> </ul> </div> </div> </details><a class="docs-nav-toplink" href="/__pyric/ui/docs/trust/versioning-and-compatibility/"> Trust </a><details class="docs-nav-group"> <summary>Conformance</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/conformance-scores/"> Public API coverage </a> </li><li> <a href="/__pyric/ui/docs/trust/how-we-know-it-matches-firebase/"> How we know it matches Firebase </a> </li><li> <a href="/__pyric/ui/docs/app-compat/"> App </a> </li><li> <a href="/__pyric/ui/docs/ai-compat/"> AI Logic </a> </li><li> <a href="/__pyric/ui/docs/auth-compat/"> Auth </a> </li><li> <a href="/__pyric/ui/docs/firestore-compat/"> Firestore </a> </li><li> <a href="/__pyric/ui/docs/database-compat/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/storage-compat/"> Storage </a> </li><li> <a href="/__pyric/ui/docs/messaging-compat/"> Messaging </a> </li><li> <a href="/__pyric/ui/docs/functions-rtdb-compat/"> Functions · RTDB </a> </li><li> <a href="/__pyric/ui/docs/rules-compat/"> Rules </a> </li> </ul> </div> </div> </details> <details class="docs-nav-group" open> <summary>Reference</summary> <div class="docs-nav-group-body docs-nav-group-body--reference"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/api-reference/"> API reference </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-app-reference-api/"> pyric/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-reference-api/" aria-current="page"> pyric/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth-reference-api/"> pyric/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-reference-api/"> pyric/ai </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-scripting-reference-api/"> pyric/ai/scripting </a> </li><li> <a href="/__pyric/ui/docs/pyric-database-reference-api/"> pyric/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage-reference-api/"> pyric/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-reference-api/"> pyric/messaging </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-sw-reference-api/"> pyric/messaging/sw </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules-reference-api/"> pyric/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-values-reference-api/"> pyric/firestore-values </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-reference-api/"> pyric/sandbox </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-firestore-reference-api/"> pyric/sandbox/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-database-reference-api/"> pyric/sandbox/database </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric-admin</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-admin-app-reference-api/"> pyric-admin/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-firestore-reference-api/"> pyric-admin/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-auth-reference-api/"> pyric-admin/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-database-reference-api/"> pyric-admin/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-storage-reference-api/"> pyric-admin/storage </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">create-pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/create-pyric-reference-api/"> create-pyric </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/cli</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli-credentials-node-reference-api/"> @pyric/cli/credentials/node </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-verify-reference-api/"> @pyric/cli/verify </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-reference-api/"> @pyric/cli/conformance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-browser-reference-api/"> @pyric/cli/conformance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-docs-reference-api/"> @pyric/cli/conformance/docs </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-reference-api/"> @pyric/cli/assurance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-browser-reference-api/"> @pyric/cli/assurance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-reference-api/"> @pyric/cli/bridge </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-client-reference-api/"> @pyric/cli/bridge/client </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-discover-reference-api/"> @pyric/cli/discover </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-vite-reference-api/"> @pyric/cli/vite </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-serve-worker-reference-api/"> @pyric/cli/serve/worker </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-remote-reference-api/"> @pyric/cli/remote </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-register-reference-api/"> @pyric/cli/register </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/ui</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-ui-auth-reference-api/"> @pyric/ui/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-auth-hooks-reference-api/"> @pyric/ui/auth/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-primitives-reference-api/"> @pyric/ui/primitives </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-reference-api/"> @pyric/ui/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-hooks-reference-api/"> @pyric/ui/firestore/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rtdb-reference-api/"> @pyric/ui/rtdb </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-reference-api/"> @pyric/ui/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-hooks-reference-api/"> @pyric/ui/storage/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-reference-api/"> @pyric/ui/traffic </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-hooks-reference-api/"> @pyric/ui/traffic/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-reference-api/"> @pyric/ui/events </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-hooks-reference-api/"> @pyric/ui/events/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-agents-reference-api/"> @pyric/ui/agents </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-reference-api/"> @pyric/ui/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-hooks-reference-api/"> @pyric/ui/rules/hooks </a> </li> </ul> </div> </div> </details> </nav> </details> <nav class="docs-nav" aria-label="Documentation"> <div class="docs-search" data-index-url="/__pyric/ui/docs/index.json"> <div class="docs-search-field"> <svg class="docs-search-icon" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"> <path d="M11.5 11.5 15 15M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"></path> </svg> <input type="text" class="docs-search-input" placeholder="Search docs" aria-label="Search docs" autocomplete="off" spellcheck="false"> <kbd class="docs-search-kbd">⌘K</kbd> </div> <ul class="docs-search-results" hidden></ul> </div> <a class="docs-nav-toplink" href="/__pyric/ui/docs/overview/" id="nav-group-overview"> Overview </a><details class="docs-nav-group" id="nav-group-get-started"> <summary>Get started</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/get-started/start-building/"> Quickstart </a> </li><li> <a href="/__pyric/ui/docs/get-started/how-the-swap-works/"> How the swap works </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-build"> <summary>Build</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/build/authentication/"> Authentication </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-firestore/"> Cloud Firestore </a> </li><li> <a href="/__pyric/ui/docs/build/realtime-database/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-storage/"> Cloud Storage </a> </li><li> <a href="/__pyric/ui/docs/build/cloud-messaging/"> Cloud Messaging </a> </li><li> <a href="/__pyric/ui/docs/build/ai-logic/"> AI Logic </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-secure-debug"> <summary>Secure & debug</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/secure/secure-it-with-rules/"> Security Rules </a> </li><li> <a href="/__pyric/ui/docs/secure/simulate-and-lint/"> Simulate and lint before you deploy </a> </li><li> <a href="/__pyric/ui/docs/secure/write-a-rules-test-suite/"> Write a rules test suite </a> </li><li> <a href="/__pyric/ui/docs/secure/read-a-denial/"> Read a denial and understand it </a> </li><li> <a href="/__pyric/ui/docs/secure/rules-standard-library/"> The rules standard library </a> </li><li> <a href="/__pyric/ui/docs/secure/rtdb-rules-in-typescript/"> RTDB rules in TypeScript </a> </li><li> <a href="/__pyric/ui/docs/secure/firestore-rules-limits/"> Rules limits </a> </li><li> <a href="/__pyric/ui/docs/secure/audit-your-rules/"> Audit rules and data </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-observe-shape"> <summary>Observe & shape</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/observe/see-whats-happening/"> Traffic & rule verdicts </a> </li><li> <a href="/__pyric/ui/docs/observe/shape-your-data/"> Seed, snapshot, replay </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-ship-test"> <summary>Ship & test</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/ship/ship-to-production/"> Ship to production </a> </li><li> <a href="/__pyric/ui/docs/ship/test-in-node/"> Test in Node </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-work-with-an-agent"> <summary>Work with an agent</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/agent/set-up-your-agent/"> Connect an agent </a> </li><li> <a href="/__pyric/ui/docs/agent/work-with-an-agent/"> Use the MCP tools </a> </li><li> <a href="/__pyric/ui/docs/agent/watch-and-review/"> Watch in Pyric Studio </a> </li> </ul> </div> </div> </details><a class="docs-nav-toplink" href="/__pyric/ui/docs/trust/versioning-and-compatibility/" id="nav-group-trust"> Trust </a><details class="docs-nav-group" id="nav-group-conformance"> <summary>Conformance</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/conformance-scores/"> Public API coverage </a> </li><li> <a href="/__pyric/ui/docs/trust/how-we-know-it-matches-firebase/"> How we know it matches Firebase </a> </li><li> <a href="/__pyric/ui/docs/app-compat/"> App </a> </li><li> <a href="/__pyric/ui/docs/ai-compat/"> AI Logic </a> </li><li> <a href="/__pyric/ui/docs/auth-compat/"> Auth </a> </li><li> <a href="/__pyric/ui/docs/firestore-compat/"> Firestore </a> </li><li> <a href="/__pyric/ui/docs/database-compat/"> Realtime Database </a> </li><li> <a href="/__pyric/ui/docs/storage-compat/"> Storage </a> </li><li> <a href="/__pyric/ui/docs/messaging-compat/"> Messaging </a> </li><li> <a href="/__pyric/ui/docs/functions-rtdb-compat/"> Functions · RTDB </a> </li><li> <a href="/__pyric/ui/docs/rules-compat/"> Rules </a> </li> </ul> </div> </div> </details> <details class="docs-nav-group" id="nav-group-reference" open> <summary>Reference</summary> <div class="docs-nav-group-body docs-nav-group-body--reference"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/api-reference/"> API reference </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-app-reference-api/"> pyric/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-reference-api/" aria-current="page"> pyric/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-auth-reference-api/"> pyric/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-reference-api/"> pyric/ai </a> </li><li> <a href="/__pyric/ui/docs/pyric-ai-scripting-reference-api/"> pyric/ai/scripting </a> </li><li> <a href="/__pyric/ui/docs/pyric-database-reference-api/"> pyric/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-storage-reference-api/"> pyric/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-reference-api/"> pyric/messaging </a> </li><li> <a href="/__pyric/ui/docs/pyric-messaging-sw-reference-api/"> pyric/messaging/sw </a> </li><li> <a href="/__pyric/ui/docs/pyric-rules-reference-api/"> pyric/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-firestore-values-reference-api/"> pyric/firestore-values </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-reference-api/"> pyric/sandbox </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-firestore-reference-api/"> pyric/sandbox/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-sandbox-database-reference-api/"> pyric/sandbox/database </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">pyric-admin</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-admin-app-reference-api/"> pyric-admin/app </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-firestore-reference-api/"> pyric-admin/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-auth-reference-api/"> pyric-admin/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-database-reference-api/"> pyric-admin/database </a> </li><li> <a href="/__pyric/ui/docs/pyric-admin-storage-reference-api/"> pyric-admin/storage </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">create-pyric</h2> <ul> <li> <a href="/__pyric/ui/docs/create-pyric-reference-api/"> create-pyric </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/cli</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-cli-credentials-node-reference-api/"> @pyric/cli/credentials/node </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-verify-reference-api/"> @pyric/cli/verify </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-reference-api/"> @pyric/cli/conformance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-browser-reference-api/"> @pyric/cli/conformance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-conformance-docs-reference-api/"> @pyric/cli/conformance/docs </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-reference-api/"> @pyric/cli/assurance </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-assurance-browser-reference-api/"> @pyric/cli/assurance/browser </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-reference-api/"> @pyric/cli/bridge </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-bridge-client-reference-api/"> @pyric/cli/bridge/client </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-discover-reference-api/"> @pyric/cli/discover </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-vite-reference-api/"> @pyric/cli/vite </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-serve-worker-reference-api/"> @pyric/cli/serve/worker </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-remote-reference-api/"> @pyric/cli/remote </a> </li><li> <a href="/__pyric/ui/docs/pyric-cli-register-reference-api/"> @pyric/cli/register </a> </li> </ul> </div><div class="docs-nav-section"> <h2 class="docs-nav-heading">@pyric/ui</h2> <ul> <li> <a href="/__pyric/ui/docs/pyric-ui-auth-reference-api/"> @pyric/ui/auth </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-auth-hooks-reference-api/"> @pyric/ui/auth/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-primitives-reference-api/"> @pyric/ui/primitives </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-reference-api/"> @pyric/ui/firestore </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-firestore-hooks-reference-api/"> @pyric/ui/firestore/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rtdb-reference-api/"> @pyric/ui/rtdb </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-reference-api/"> @pyric/ui/storage </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-storage-hooks-reference-api/"> @pyric/ui/storage/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-reference-api/"> @pyric/ui/traffic </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-traffic-hooks-reference-api/"> @pyric/ui/traffic/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-reference-api/"> @pyric/ui/events </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-events-hooks-reference-api/"> @pyric/ui/events/hooks </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-agents-reference-api/"> @pyric/ui/agents </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-reference-api/"> @pyric/ui/rules </a> </li><li> <a href="/__pyric/ui/docs/pyric-ui-rules-hooks-reference-api/"> @pyric/ui/rules/hooks </a> </li> </ul> </div> </div> </details> </nav> <main class="doc-main"> <nav class="docs-breadcrumbs" aria-label="Breadcrumb"> <ol> <li> <a href="/__pyric/ui/docs/api-reference/">API reference</a> </li><li> <span class="docs-breadcrumbs-sep" aria-hidden="true">/</span> <span>pyric</span> </li><li> <span class="docs-breadcrumbs-sep" aria-hidden="true">/</span> <span aria-current="page">pyric/firestore</span> </li> </ol> </nav> <header class="api-reference-header"> <p class="api-reference-kicker">API reference</p> <h1><code>pyric/firestore</code></h1> <p class="api-reference-meta"> 110 published symbols from <code>pyric</code> </p> <p class="api-reference-source">
|
|
2
3
|
Generated from the TypeScript declarations shipped at this import path.
|
|
3
4
|
</p> <a class="api-reference-evidence" href="/__pyric/ui/docs/firestore-compat/">
|
|
4
5
|
Check behavioral conformance
|
|
5
|
-
</a> </header> <article class="prose api-reference-body"> <!-- Generated from published package declarations via TypeDoc.
|
|
6
|
+
</a> </header> <article class="prose api-reference-body"> <!-- Generated from published package declarations via TypeDoc. Rendered by the api-reference content loader. -->
|
|
6
7
|
<h2 id="classes">Classes</h2>
|
|
7
8
|
<p><a id="bytes"></a></p>
|
|
8
9
|
<h3 id="bytes">Bytes</h3>
|
|
@@ -153,12 +154,18 @@ Check behavioral conformance
|
|
|
153
154
|
<h6 id="returns-9">Returns</h6>
|
|
154
155
|
<p><code>boolean</code></p>
|
|
155
156
|
<hr>
|
|
156
|
-
<p><a id="
|
|
157
|
-
<h3 id="
|
|
157
|
+
<p><a id="fieldvalue"></a></p>
|
|
158
|
+
<h3 id="fieldvalue">FieldValue</h3>
|
|
158
159
|
<h4 id="constructors-1">Constructors</h4>
|
|
159
160
|
<p><a id="constructor-1"></a></p>
|
|
160
161
|
<h5 id="constructor-1">Constructor</h5>
|
|
161
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">new</span><span style="color:#61AFEF">
|
|
162
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">new</span><span style="color:#61AFEF"> FieldValue</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">FieldValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
163
|
+
<h6 id="returns-10">Returns</h6>
|
|
164
|
+
<p><a href="#fieldvalue"><code>FieldValue</code></a></p>
|
|
165
|
+
<h4 id="methods-2">Methods</h4>
|
|
166
|
+
<p><a id="arrayremove"></a></p>
|
|
167
|
+
<h5 id="arrayremove">arrayRemove()</h5>
|
|
168
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">static</span><span style="color:#61AFEF"> arrayRemove</span><span style="color:#ABB2BF">(...</span><span style="color:#E06C75">values</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">unknown</span><span style="color:#ABB2BF">[]): </span><span style="color:#E06C75">FieldValueSentinel</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
162
169
|
<h6 id="parameters-6">Parameters</h6>
|
|
163
170
|
<div class="table-scroll">
|
|
164
171
|
|
|
@@ -173,31 +180,105 @@ Check behavioral conformance
|
|
|
173
180
|
|
|
174
181
|
|
|
175
182
|
|
|
183
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left">…<code>values</code></td><td align="left"><code>unknown</code>[]</td></tr></tbody></table></div>
|
|
184
|
+
<h6 id="returns-11">Returns</h6>
|
|
185
|
+
<p><a href="#fieldvaluesentinel"><code>FieldValueSentinel</code></a></p>
|
|
186
|
+
<p><a id="arrayunion"></a></p>
|
|
187
|
+
<h5 id="arrayunion">arrayUnion()</h5>
|
|
188
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">static</span><span style="color:#61AFEF"> arrayUnion</span><span style="color:#ABB2BF">(...</span><span style="color:#E06C75">values</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">unknown</span><span style="color:#ABB2BF">[]): </span><span style="color:#E06C75">FieldValueSentinel</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
189
|
+
<h6 id="parameters-7">Parameters</h6>
|
|
190
|
+
<div class="table-scroll">
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left">…<code>values</code></td><td align="left"><code>unknown</code>[]</td></tr></tbody></table></div>
|
|
204
|
+
<h6 id="returns-12">Returns</h6>
|
|
205
|
+
<p><a href="#fieldvaluesentinel"><code>FieldValueSentinel</code></a></p>
|
|
206
|
+
<p><a id="delete"></a></p>
|
|
207
|
+
<h5 id="delete">delete()</h5>
|
|
208
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">static</span><span style="color:#C678DD"> delete</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">FieldValueSentinel</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
209
|
+
<h6 id="returns-13">Returns</h6>
|
|
210
|
+
<p><a href="#fieldvaluesentinel"><code>FieldValueSentinel</code></a></p>
|
|
211
|
+
<p><a id="increment"></a></p>
|
|
212
|
+
<h5 id="increment">increment()</h5>
|
|
213
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">static</span><span style="color:#61AFEF"> increment</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">n</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">FieldValueSentinel</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
214
|
+
<h6 id="parameters-8">Parameters</h6>
|
|
215
|
+
<div class="table-scroll">
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>n</code></td><td align="left"><code>number</code></td></tr></tbody></table></div>
|
|
229
|
+
<h6 id="returns-14">Returns</h6>
|
|
230
|
+
<p><a href="#fieldvaluesentinel"><code>FieldValueSentinel</code></a></p>
|
|
231
|
+
<p><a id="servertimestamp"></a></p>
|
|
232
|
+
<h5 id="servertimestamp">serverTimestamp()</h5>
|
|
233
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">static</span><span style="color:#61AFEF"> serverTimestamp</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">FieldValueSentinel</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
234
|
+
<h6 id="returns-15">Returns</h6>
|
|
235
|
+
<p><a href="#fieldvaluesentinel"><code>FieldValueSentinel</code></a></p>
|
|
236
|
+
<hr>
|
|
237
|
+
<p><a id="geopoint"></a></p>
|
|
238
|
+
<h3 id="geopoint">GeoPoint</h3>
|
|
239
|
+
<h4 id="constructors-2">Constructors</h4>
|
|
240
|
+
<p><a id="constructor-2"></a></p>
|
|
241
|
+
<h5 id="constructor-2">Constructor</h5>
|
|
242
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">new</span><span style="color:#61AFEF"> GeoPoint</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">lat</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">lng</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">GeoPoint</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
243
|
+
<h6 id="parameters-9">Parameters</h6>
|
|
244
|
+
<div class="table-scroll">
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
176
257
|
|
|
177
258
|
|
|
178
259
|
|
|
179
260
|
|
|
180
261
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>lat</code></td><td align="left"><code>number</code></td></tr><tr><td align="left"><code>lng</code></td><td align="left"><code>number</code></td></tr></tbody></table></div>
|
|
181
|
-
<h6 id="returns-
|
|
262
|
+
<h6 id="returns-16">Returns</h6>
|
|
182
263
|
<p><a href="#geopoint"><code>GeoPoint</code></a></p>
|
|
183
264
|
<h4 id="accessors">Accessors</h4>
|
|
184
265
|
<p><a id="latitude"></a></p>
|
|
185
266
|
<h5 id="latitude">latitude</h5>
|
|
186
267
|
<h6 id="get-signature">Get Signature</h6>
|
|
187
268
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">get</span><span style="color:#61AFEF"> latitude</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
188
|
-
<h6 id="returns-
|
|
269
|
+
<h6 id="returns-17">Returns</h6>
|
|
189
270
|
<p><code>number</code></p>
|
|
190
271
|
<p><a id="longitude"></a></p>
|
|
191
272
|
<h5 id="longitude">longitude</h5>
|
|
192
273
|
<h6 id="get-signature-1">Get Signature</h6>
|
|
193
274
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">get</span><span style="color:#61AFEF"> longitude</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
194
|
-
<h6 id="returns-
|
|
275
|
+
<h6 id="returns-18">Returns</h6>
|
|
195
276
|
<p><code>number</code></p>
|
|
196
|
-
<h4 id="methods-
|
|
277
|
+
<h4 id="methods-3">Methods</h4>
|
|
197
278
|
<p><a id="isequal-4"></a></p>
|
|
198
279
|
<h5 id="isequal-2">isEqual()</h5>
|
|
199
280
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">isEqual</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">other</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">GeoPoint</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
200
|
-
<h6 id="parameters-
|
|
281
|
+
<h6 id="parameters-10">Parameters</h6>
|
|
201
282
|
<div class="table-scroll">
|
|
202
283
|
|
|
203
284
|
|
|
@@ -212,7 +293,7 @@ Check behavioral conformance
|
|
|
212
293
|
|
|
213
294
|
|
|
214
295
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>other</code></td><td align="left"><a href="#geopoint"><code>GeoPoint</code></a></td></tr></tbody></table></div>
|
|
215
|
-
<h6 id="returns-
|
|
296
|
+
<h6 id="returns-19">Returns</h6>
|
|
216
297
|
<p><code>boolean</code></p>
|
|
217
298
|
<p><a id="tojson-2"></a></p>
|
|
218
299
|
<h5 id="tojson-1">toJSON()</h5>
|
|
@@ -221,7 +302,7 @@ Check behavioral conformance
|
|
|
221
302
|
<span class="line"><span style="color:#E06C75"> longitude</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">;</span></span>
|
|
222
303
|
<span class="line"><span style="color:#E06C75"> type</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">;</span></span>
|
|
223
304
|
<span class="line"><span style="color:#ABB2BF">};</span></span></code></pre>
|
|
224
|
-
<h6 id="returns-
|
|
305
|
+
<h6 id="returns-20">Returns</h6>
|
|
225
306
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">{</span></span>
|
|
226
307
|
<span class="line"><span style="color:#E06C75"> latitude</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">;</span></span>
|
|
227
308
|
<span class="line"><span style="color:#E06C75"> longitude</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">;</span></span>
|
|
@@ -236,7 +317,7 @@ Check behavioral conformance
|
|
|
236
317
|
<p><a id="fromjson-2"></a></p>
|
|
237
318
|
<h5 id="fromjson-1">fromJSON()</h5>
|
|
238
319
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">static</span><span style="color:#61AFEF"> fromJSON</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">json</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">object</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">GeoPoint</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
239
|
-
<h6 id="parameters-
|
|
320
|
+
<h6 id="parameters-11">Parameters</h6>
|
|
240
321
|
<div class="table-scroll">
|
|
241
322
|
|
|
242
323
|
|
|
@@ -251,16 +332,164 @@ Check behavioral conformance
|
|
|
251
332
|
|
|
252
333
|
|
|
253
334
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>json</code></td><td align="left"><code>object</code></td></tr></tbody></table></div>
|
|
254
|
-
<h6 id="returns-
|
|
335
|
+
<h6 id="returns-21">Returns</h6>
|
|
255
336
|
<p><a href="#geopoint"><code>GeoPoint</code></a></p>
|
|
256
337
|
<hr>
|
|
257
|
-
<p><a id="
|
|
258
|
-
<h3 id="
|
|
259
|
-
<
|
|
338
|
+
<p><a id="sandboxerror"></a></p>
|
|
339
|
+
<h3 id="sandboxerror">SandboxError</h3>
|
|
340
|
+
<p>Sandbox-layer error. Catch with <code>instanceof SandboxError</code> and switch
|
|
341
|
+
on <code>code</code>. <code>denialContext</code> is populated for <code>permission-denied</code> only
|
|
342
|
+
(and only after Slice 4 wires it through).</p>
|
|
343
|
+
<p>Two construction forms are supported:</p>
|
|
344
|
+
<ul>
|
|
345
|
+
<li>Positional: <code>new SandboxError(code, message, denialContext?)</code> —
|
|
346
|
+
the original signature, kept for backward compatibility with
|
|
347
|
+
existing internal call sites.</li>
|
|
348
|
+
<li>Options bag: <code>new SandboxError({ code, message, remediation? })</code> —
|
|
349
|
+
used when attaching remediation guidance.</li>
|
|
350
|
+
</ul>
|
|
351
|
+
<h4 id="extends">Extends</h4>
|
|
352
|
+
<ul>
|
|
353
|
+
<li><code>Error</code></li>
|
|
354
|
+
</ul>
|
|
355
|
+
<h4 id="constructors-3">Constructors</h4>
|
|
356
|
+
<p><a id="constructor-3"></a></p>
|
|
357
|
+
<h5 id="constructor-3">Constructor</h5>
|
|
358
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">new</span><span style="color:#61AFEF"> SandboxError</span><span style="color:#ABB2BF">(</span></span>
|
|
359
|
+
<span class="line"><span style="color:#E06C75"> code</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">SandboxErrorCode</span><span style="color:#ABB2BF">,</span></span>
|
|
360
|
+
<span class="line"><span style="color:#E06C75"> message</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">,</span></span>
|
|
361
|
+
<span class="line"><span style="color:#E06C75"> denialContext</span><span style="color:#C678DD">?:</span><span style="color:#E06C75"> DenialContext</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">SandboxError</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
362
|
+
<h6 id="parameters-12">Parameters</h6>
|
|
363
|
+
<div class="table-scroll">
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>code</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#sandboxerrorcode"><code>SandboxErrorCode</code></a></td></tr><tr><td align="left"><code>message</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><code>denialContext?</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#denialcontext"><code>DenialContext</code></a></td></tr></tbody></table></div>
|
|
385
|
+
<h6 id="returns-22">Returns</h6>
|
|
386
|
+
<p><a href="#sandboxerror"><code>SandboxError</code></a></p>
|
|
387
|
+
<h6 id="overrides">Overrides</h6>
|
|
388
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E5C07B">Error</span><span style="color:#ABB2BF">.</span><span style="color:#E06C75">constructor</span></span></code></pre>
|
|
389
|
+
<h5 id="constructor-4">Constructor</h5>
|
|
390
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">new</span><span style="color:#61AFEF"> SandboxError</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">options</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">SandboxErrorOptions</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">SandboxError</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
391
|
+
<h6 id="parameters-13">Parameters</h6>
|
|
392
|
+
<div class="table-scroll">
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>options</code></td><td align="left"><code>SandboxErrorOptions</code></td></tr></tbody></table></div>
|
|
406
|
+
<h6 id="returns-23">Returns</h6>
|
|
407
|
+
<p><a href="#sandboxerror"><code>SandboxError</code></a></p>
|
|
408
|
+
<h6 id="overrides-1">Overrides</h6>
|
|
409
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E5C07B">Error</span><span style="color:#ABB2BF">.</span><span style="color:#E06C75">constructor</span></span></code></pre>
|
|
410
|
+
<h4 id="properties">Properties</h4>
|
|
411
|
+
<div class="table-scroll">
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="code"></a> <code>code</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#sandboxerrorcode"><code>SandboxErrorCode</code></a></td></tr><tr><td align="left"><a id="denialcontext"></a> <code>denialContext?</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#denialcontext"><code>DenialContext</code></a></td></tr><tr><td align="left"><a id="remediation"></a> <code>remediation?</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
437
|
+
<hr>
|
|
438
|
+
<p><a id="timestamp"></a></p>
|
|
439
|
+
<h3 id="timestamp">Timestamp</h3>
|
|
440
|
+
<h4 id="constructors-4">Constructors</h4>
|
|
441
|
+
<p><a id="constructor-4"></a></p>
|
|
442
|
+
<h5 id="constructor-5">Constructor</h5>
|
|
443
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">new</span><span style="color:#61AFEF"> Timestamp</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">seconds</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">nanoseconds</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">Timestamp</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
444
|
+
<h6 id="parameters-14">Parameters</h6>
|
|
445
|
+
<div class="table-scroll">
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>seconds</code></td><td align="left"><code>number</code></td></tr><tr><td align="left"><code>nanoseconds</code></td><td align="left"><code>number</code></td></tr></tbody></table></div>
|
|
463
|
+
<h6 id="returns-24">Returns</h6>
|
|
464
|
+
<p><a href="#timestamp"><code>Timestamp</code></a></p>
|
|
465
|
+
<h4 id="properties-1">Properties</h4>
|
|
466
|
+
<div class="table-scroll">
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="nanoseconds"></a> <code>nanoseconds</code></td><td align="left"><code>readonly</code></td><td align="left"><code>number</code></td></tr><tr><td align="left"><a id="seconds"></a> <code>seconds</code></td><td align="left"><code>readonly</code></td><td align="left"><code>number</code></td></tr></tbody></table></div>
|
|
487
|
+
<h4 id="methods-4">Methods</h4>
|
|
260
488
|
<p><a id="isequal-6"></a></p>
|
|
261
489
|
<h5 id="isequal-3">isEqual()</h5>
|
|
262
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">isEqual</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">other</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">
|
|
263
|
-
<
|
|
490
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">isEqual</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">other</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">Timestamp</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
491
|
+
<p>FS-B12 — value equality, mirroring <code>fb.Timestamp.isEqual</code>.</p>
|
|
492
|
+
<h6 id="parameters-15">Parameters</h6>
|
|
264
493
|
<div class="table-scroll">
|
|
265
494
|
|
|
266
495
|
|
|
@@ -274,23 +503,58 @@ Check behavioral conformance
|
|
|
274
503
|
|
|
275
504
|
|
|
276
505
|
|
|
277
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>other</code></td><td align="left"><a href="#
|
|
278
|
-
<h6 id="returns-
|
|
506
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>other</code></td><td align="left"><a href="#timestamp"><code>Timestamp</code></a></td></tr></tbody></table></div>
|
|
507
|
+
<h6 id="returns-25">Returns</h6>
|
|
279
508
|
<p><code>boolean</code></p>
|
|
280
|
-
<p><a id="
|
|
281
|
-
<h5 id="
|
|
282
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">
|
|
283
|
-
<h6 id="returns-
|
|
284
|
-
<p><code>
|
|
509
|
+
<p><a id="todate"></a></p>
|
|
510
|
+
<h5 id="todate">toDate()</h5>
|
|
511
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">toDate</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">Date</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
512
|
+
<h6 id="returns-26">Returns</h6>
|
|
513
|
+
<p><code>Date</code></p>
|
|
285
514
|
<p><a id="tojson-4"></a></p>
|
|
286
515
|
<h5 id="tojson-2">toJSON()</h5>
|
|
287
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">toJSON</span><span style="color:#ABB2BF">(): </span
|
|
288
|
-
<
|
|
289
|
-
<
|
|
290
|
-
<
|
|
291
|
-
<
|
|
292
|
-
<
|
|
293
|
-
<h6 id="
|
|
516
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">toJSON</span><span style="color:#ABB2BF">(): {</span></span>
|
|
517
|
+
<span class="line"><span style="color:#E06C75"> nanoseconds</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">;</span></span>
|
|
518
|
+
<span class="line"><span style="color:#E06C75"> seconds</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">;</span></span>
|
|
519
|
+
<span class="line"><span style="color:#E06C75"> type</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">;</span></span>
|
|
520
|
+
<span class="line"><span style="color:#ABB2BF">};</span></span></code></pre>
|
|
521
|
+
<p>FS-B12 — JSON form, mirroring <code>fb.Timestamp.toJSON</code>.</p>
|
|
522
|
+
<h6 id="returns-27">Returns</h6>
|
|
523
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">{</span></span>
|
|
524
|
+
<span class="line"><span style="color:#E06C75"> nanoseconds</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">;</span></span>
|
|
525
|
+
<span class="line"><span style="color:#E06C75"> seconds</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">;</span></span>
|
|
526
|
+
<span class="line"><span style="color:#E06C75"> type</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">;</span></span>
|
|
527
|
+
<span class="line"><span style="color:#ABB2BF">}</span></span></code></pre>
|
|
528
|
+
<h6 id="nanoseconds">nanoseconds</h6>
|
|
529
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">nanoseconds</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
530
|
+
<h6 id="seconds">seconds</h6>
|
|
531
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">seconds</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
532
|
+
<h6 id="type-1">type</h6>
|
|
533
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">type</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
534
|
+
<p><a id="tomillis"></a></p>
|
|
535
|
+
<h5 id="tomillis">toMillis()</h5>
|
|
536
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">toMillis</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
537
|
+
<h6 id="returns-28">Returns</h6>
|
|
538
|
+
<p><code>number</code></p>
|
|
539
|
+
<p><a id="tostring-2"></a></p>
|
|
540
|
+
<h5 id="tostring-1">toString()</h5>
|
|
541
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">toString</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
542
|
+
<p>FS-B12 — textual form, mirroring <code>fb.Timestamp.toString</code>.</p>
|
|
543
|
+
<h6 id="returns-29">Returns</h6>
|
|
544
|
+
<p><code>string</code></p>
|
|
545
|
+
<p><a id="valueof"></a></p>
|
|
546
|
+
<h5 id="valueof">valueOf()</h5>
|
|
547
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">valueOf</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
548
|
+
<p>FS-B12 — primitive coercion for <code><</code>/<code><=</code>/<code>>=</code>/<code>></code> comparisons, mirroring
|
|
549
|
+
<code>fb.Timestamp.valueOf</code>: a zero-padded <code><seconds>.<nanoseconds></code> string
|
|
550
|
+
(seconds offset by MIN_SECONDS so it stays non-negative and lexically
|
|
551
|
+
ordered).</p>
|
|
552
|
+
<h6 id="returns-30">Returns</h6>
|
|
553
|
+
<p><code>string</code></p>
|
|
554
|
+
<p><a id="fromdate"></a></p>
|
|
555
|
+
<h5 id="fromdate">fromDate()</h5>
|
|
556
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">static</span><span style="color:#61AFEF"> fromDate</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">d</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">Date</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">Timestamp</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
557
|
+
<h6 id="parameters-16">Parameters</h6>
|
|
294
558
|
<div class="table-scroll">
|
|
295
559
|
|
|
296
560
|
|
|
@@ -304,13 +568,492 @@ Check behavioral conformance
|
|
|
304
568
|
|
|
305
569
|
|
|
306
570
|
|
|
307
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>
|
|
308
|
-
<h6 id="returns-
|
|
309
|
-
<p><a href="#
|
|
310
|
-
<p><a id="
|
|
311
|
-
<h5 id="
|
|
312
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">static</span><span style="color:#61AFEF">
|
|
313
|
-
<h6 id="parameters-
|
|
571
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>d</code></td><td align="left"><code>Date</code></td></tr></tbody></table></div>
|
|
572
|
+
<h6 id="returns-31">Returns</h6>
|
|
573
|
+
<p><a href="#timestamp"><code>Timestamp</code></a></p>
|
|
574
|
+
<p><a id="frommillis"></a></p>
|
|
575
|
+
<h5 id="frommillis">fromMillis()</h5>
|
|
576
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">static</span><span style="color:#61AFEF"> fromMillis</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">ms</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">Timestamp</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
577
|
+
<h6 id="parameters-17">Parameters</h6>
|
|
578
|
+
<div class="table-scroll">
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ms</code></td><td align="left"><code>number</code></td></tr></tbody></table></div>
|
|
592
|
+
<h6 id="returns-32">Returns</h6>
|
|
593
|
+
<p><a href="#timestamp"><code>Timestamp</code></a></p>
|
|
594
|
+
<p><a id="now"></a></p>
|
|
595
|
+
<h5 id="now">now()</h5>
|
|
596
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">static</span><span style="color:#61AFEF"> now</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">Timestamp</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
597
|
+
<h6 id="returns-33">Returns</h6>
|
|
598
|
+
<p><a href="#timestamp"><code>Timestamp</code></a></p>
|
|
599
|
+
<hr>
|
|
600
|
+
<p><a id="vectorvalue"></a></p>
|
|
601
|
+
<h3 id="vectorvalue">VectorValue</h3>
|
|
602
|
+
<h4 id="methods-5">Methods</h4>
|
|
603
|
+
<p><a id="isequal-8"></a></p>
|
|
604
|
+
<h5 id="isequal-4">isEqual()</h5>
|
|
605
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">isEqual</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">other</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">VectorValue</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
606
|
+
<h6 id="parameters-18">Parameters</h6>
|
|
607
|
+
<div class="table-scroll">
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>other</code></td><td align="left"><a href="#vectorvalue"><code>VectorValue</code></a></td></tr></tbody></table></div>
|
|
621
|
+
<h6 id="returns-34">Returns</h6>
|
|
622
|
+
<p><code>boolean</code></p>
|
|
623
|
+
<p><a id="toarray"></a></p>
|
|
624
|
+
<h5 id="toarray">toArray()</h5>
|
|
625
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">toArray</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">[];</span></span></code></pre>
|
|
626
|
+
<h6 id="returns-35">Returns</h6>
|
|
627
|
+
<p><code>number</code>[]</p>
|
|
628
|
+
<p><a id="tojson-6"></a></p>
|
|
629
|
+
<h5 id="tojson-3">toJSON()</h5>
|
|
630
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">toJSON</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">object</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
631
|
+
<h6 id="returns-36">Returns</h6>
|
|
632
|
+
<p><code>object</code></p>
|
|
633
|
+
<p><a id="create"></a></p>
|
|
634
|
+
<h5 id="create">create()</h5>
|
|
635
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">static</span><span style="color:#61AFEF"> create</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">values</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">[]): </span><span style="color:#E06C75">VectorValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
636
|
+
<h6 id="parameters-19">Parameters</h6>
|
|
637
|
+
<div class="table-scroll">
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>values</code></td><td align="left"><code>number</code>[]</td></tr></tbody></table></div>
|
|
651
|
+
<h6 id="returns-37">Returns</h6>
|
|
652
|
+
<p><a href="#vectorvalue"><code>VectorValue</code></a></p>
|
|
653
|
+
<p><a id="fromjson-4"></a></p>
|
|
654
|
+
<h5 id="fromjson-2">fromJSON()</h5>
|
|
655
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">static</span><span style="color:#61AFEF"> fromJSON</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">json</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">object</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">VectorValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
656
|
+
<h6 id="parameters-20">Parameters</h6>
|
|
657
|
+
<div class="table-scroll">
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>json</code></td><td align="left"><code>object</code></td></tr></tbody></table></div>
|
|
671
|
+
<h6 id="returns-38">Returns</h6>
|
|
672
|
+
<p><a href="#vectorvalue"><code>VectorValue</code></a></p>
|
|
673
|
+
<h2 id="interfaces">Interfaces</h2>
|
|
674
|
+
<p><a id="aggregatequerysnapshot"></a></p>
|
|
675
|
+
<h3 id="aggregatequerysnapshot">AggregateQuerySnapshot</h3>
|
|
676
|
+
<p>Snapshot returned by <code>getCountFromServer</code> /
|
|
677
|
+
<code>getAggregateFromServer</code>. <code>.data()</code> returns the computed numbers
|
|
678
|
+
keyed by the spec’s aliases (or <code>{ count: number }</code> for the
|
|
679
|
+
count-only entry point).</p>
|
|
680
|
+
<h4 id="type-parameters">Type Parameters</h4>
|
|
681
|
+
<div class="table-scroll">
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code> <em>extends</em> <code>Record</code><<code>string</code>, <code>number</code> | <code>null</code>></td><td align="left"><code>Record</code><<code>string</code>, <code>number</code> | <code>null</code>></td></tr></tbody></table></div>
|
|
695
|
+
<h4 id="methods-6">Methods</h4>
|
|
696
|
+
<p><a id="data"></a></p>
|
|
697
|
+
<h5 id="data">data()</h5>
|
|
698
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">data</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
699
|
+
<h6 id="returns-39">Returns</h6>
|
|
700
|
+
<p><code>T</code></p>
|
|
701
|
+
<hr>
|
|
702
|
+
<p><a id="collectionreference"></a></p>
|
|
703
|
+
<h3 id="collectionreference">CollectionReference</h3>
|
|
704
|
+
<p>A reference to a Firestore collection. Backend-opaque.</p>
|
|
705
|
+
<h4 id="type-parameters-1">Type Parameters</h4>
|
|
706
|
+
<div class="table-scroll">
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>_T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
720
|
+
<h4 id="properties-2">Properties</h4>
|
|
721
|
+
<div class="table-scroll">
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="id"></a> <code>id</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><a id="path"></a> <code>path</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
742
|
+
<hr>
|
|
743
|
+
<p><a id="documentreference"></a></p>
|
|
744
|
+
<h3 id="documentreference">DocumentReference</h3>
|
|
745
|
+
<p>A reference to a Firestore document. Backend-opaque.</p>
|
|
746
|
+
<h4 id="type-parameters-2">Type Parameters</h4>
|
|
747
|
+
<div class="table-scroll">
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>_T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
761
|
+
<h4 id="properties-3">Properties</h4>
|
|
762
|
+
<div class="table-scroll">
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="id-1"></a> <code>id</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><a id="path-1"></a> <code>path</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
783
|
+
<hr>
|
|
784
|
+
<p><a id="documentsnapshot"></a></p>
|
|
785
|
+
<h3 id="documentsnapshot">DocumentSnapshot</h3>
|
|
786
|
+
<p>A point-in-time view of one document.</p>
|
|
787
|
+
<h4 id="extended-by">Extended by</h4>
|
|
788
|
+
<ul>
|
|
789
|
+
<li><a href="#querydocumentsnapshot"><code>QueryDocumentSnapshot</code></a></li>
|
|
790
|
+
</ul>
|
|
791
|
+
<h4 id="type-parameters-3">Type Parameters</h4>
|
|
792
|
+
<div class="table-scroll">
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
806
|
+
<h4 id="properties-4">Properties</h4>
|
|
807
|
+
<div class="table-scroll">
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="exists"></a> <code>exists</code></td><td align="left"><code>readonly</code></td><td align="left"><code>boolean</code> | () => <code>boolean</code></td></tr><tr><td align="left"><a id="id-2"></a> <code>id</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
828
|
+
<h4 id="methods-7">Methods</h4>
|
|
829
|
+
<p><a id="data-2"></a></p>
|
|
830
|
+
<h5 id="data-1">data()</h5>
|
|
831
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">data</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
832
|
+
<h6 id="returns-40">Returns</h6>
|
|
833
|
+
<p><code>T</code></p>
|
|
834
|
+
<hr>
|
|
835
|
+
<p><a id="firestore"></a></p>
|
|
836
|
+
<h3 id="firestore">Firestore</h3>
|
|
837
|
+
<p>Opaque sandbox handle carrying its owner via <a href="#target_symbol-1">TARGET_SYMBOL</a>.</p>
|
|
838
|
+
<h4 id="properties-5">Properties</h4>
|
|
839
|
+
<div class="table-scroll">
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="target_symbol"></a> <code>[TARGET_SYMBOL]</code></td><td align="left"><code>readonly</code></td><td align="left"><code>Target</code></td></tr><tr><td align="left"><a id="app"></a> <code>app?</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="/docs/pyric-app-reference-api/#firebaseapp"><code>FirebaseApp</code></a></td></tr></tbody></table></div>
|
|
860
|
+
<hr>
|
|
861
|
+
<p><a id="firestoredataconverter"></a></p>
|
|
862
|
+
<h3 id="firestoredataconverter">FirestoreDataConverter</h3>
|
|
863
|
+
<p>Pair of translators between the consumer’s app model and the
|
|
864
|
+
underlying Firestore representation. Mirrors <code>firebase/firestore</code>’s
|
|
865
|
+
<code>FirestoreDataConverter</code> shape.</p>
|
|
866
|
+
<ul>
|
|
867
|
+
<li><code>toFirestore(model)</code> runs on every write (<code>setDoc</code>, <code>addDoc</code>)
|
|
868
|
+
through a converted ref. Returns the <code>DocumentData</code> to send.</li>
|
|
869
|
+
<li><code>fromFirestore(snapshot)</code> runs on every read (<code>getDoc</code>,
|
|
870
|
+
<code>getDocs</code>, snapshot listener callback) through a converted ref.
|
|
871
|
+
Receives the raw snapshot, returns the typed model.</li>
|
|
872
|
+
</ul>
|
|
873
|
+
<h4 id="type-parameters-4">Type Parameters</h4>
|
|
874
|
+
<div class="table-scroll">
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>AppModelType</code></td><td align="left">-</td></tr><tr><td align="left"><code>DbModelType</code> <em>extends</em> <a href="#documentdata"><code>DocumentData</code></a></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
892
|
+
<h4 id="methods-8">Methods</h4>
|
|
893
|
+
<p><a id="fromfirestore"></a></p>
|
|
894
|
+
<h5 id="fromfirestore">fromFirestore()</h5>
|
|
895
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">fromFirestore</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">snapshot</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">QueryDocumentSnapshot</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">DbModelType</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">AppModelType</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
896
|
+
<h6 id="parameters-21">Parameters</h6>
|
|
897
|
+
<div class="table-scroll">
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>snapshot</code></td><td align="left"><a href="#querydocumentsnapshot"><code>QueryDocumentSnapshot</code></a><<code>DbModelType</code>></td></tr></tbody></table></div>
|
|
911
|
+
<h6 id="returns-41">Returns</h6>
|
|
912
|
+
<p><code>AppModelType</code></p>
|
|
913
|
+
<p><a id="tofirestore"></a></p>
|
|
914
|
+
<h5 id="tofirestore">toFirestore()</h5>
|
|
915
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">toFirestore</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">modelObject</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">AppModelType</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">DbModelType</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
916
|
+
<h6 id="parameters-22">Parameters</h6>
|
|
917
|
+
<div class="table-scroll">
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>modelObject</code></td><td align="left"><code>AppModelType</code></td></tr></tbody></table></div>
|
|
931
|
+
<h6 id="returns-42">Returns</h6>
|
|
932
|
+
<p><code>DbModelType</code></p>
|
|
933
|
+
<hr>
|
|
934
|
+
<p><a id="firestoredatatooldeps"></a></p>
|
|
935
|
+
<h3 id="firestoredatatooldeps">FirestoreDataToolDeps</h3>
|
|
936
|
+
<h4 id="methods-9">Methods</h4>
|
|
937
|
+
<p><a id="resolvedb"></a></p>
|
|
938
|
+
<h5 id="resolvedb">resolveDb()</h5>
|
|
939
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">resolveDb</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">as</span><span style="color:#C678DD">?:</span><span style="color:#E06C75"> As</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">Firestore</span><span style="color:#56B6C2"> |</span><span style="color:#E5C07B"> Promise</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">Firestore</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
940
|
+
<p>Resolver returning a <code>Firestore</code> handle. Called per-dispatch with the
|
|
941
|
+
op’s <code>as</code> value: <code>'admin'</code> (or undefined) → an admin-bypass Firestore;
|
|
942
|
+
<code>{ uid, claims? }</code> → a rules-enforcing Firestore acting as that user.</p>
|
|
943
|
+
<p>The host decides the posture; the tool layer does NOT enforce it. A sandbox
|
|
944
|
+
resolver may default to admin (rules bypass is the point of seeding), but a
|
|
945
|
+
resolver wired to a real backend should require an explicit identity or
|
|
946
|
+
confirm-gate admin writes (see the bridge’s prod confirm-policy).</p>
|
|
947
|
+
<h6 id="parameters-23">Parameters</h6>
|
|
948
|
+
<div class="table-scroll">
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>as?</code></td><td align="left"><a href="#as"><code>As</code></a></td></tr></tbody></table></div>
|
|
962
|
+
<h6 id="returns-43">Returns</h6>
|
|
963
|
+
<p><a href="#firestore"><code>Firestore</code></a> | <code>Promise</code><<a href="#firestore"><code>Firestore</code></a>></p>
|
|
964
|
+
<hr>
|
|
965
|
+
<p><a id="firestoreinspecttooldeps"></a></p>
|
|
966
|
+
<h3 id="firestoreinspecttooldeps">FirestoreInspectToolDeps</h3>
|
|
967
|
+
<h4 id="methods-10">Methods</h4>
|
|
968
|
+
<p><a id="resolvesandbox"></a></p>
|
|
969
|
+
<h5 id="resolvesandbox">resolveSandbox()</h5>
|
|
970
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">resolveSandbox</span><span style="color:#ABB2BF">():</span></span>
|
|
971
|
+
<span class="line"><span style="color:#56B6C2"> |</span><span style="color:#E06C75"> LocalSandbox</span></span>
|
|
972
|
+
<span class="line"><span style="color:#56B6C2">|</span><span style="color:#E5C07B"> Promise</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">LocalSandbox</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
973
|
+
<p>Resolve the sandbox whose Firestore state should be inspected.</p>
|
|
974
|
+
<h6 id="returns-44">Returns</h6>
|
|
975
|
+
<p>| <a href="/docs/pyric-sandbox-reference-api/#localsandbox"><code>LocalSandbox</code></a>
|
|
976
|
+
| <code>Promise</code><<a href="/docs/pyric-sandbox-reference-api/#localsandbox"><code>LocalSandbox</code></a>></p>
|
|
977
|
+
<hr>
|
|
978
|
+
<p><a id="firestoresettings"></a></p>
|
|
979
|
+
<h3 id="firestoresettings">FirestoreSettings</h3>
|
|
980
|
+
<p>Client-cache/network settings <code>initializeFirestore</code> accepts but no-ops
|
|
981
|
+
on sandbox targets — see the tier-1 section rationale above.</p>
|
|
982
|
+
<h4 id="properties-6">Properties</h4>
|
|
983
|
+
<div class="table-scroll">
|
|
984
|
+
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
|
|
1007
|
+
|
|
1008
|
+
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
|
|
1020
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="cachesizebytes"></a> <code>cacheSizeBytes?</code></td><td align="left"><code>number</code></td></tr><tr><td align="left"><a id="experimentalautodetectlongpolling"></a> <code>experimentalAutoDetectLongPolling?</code></td><td align="left"><code>boolean</code></td></tr><tr><td align="left"><a id="experimentalforcelongpolling"></a> <code>experimentalForceLongPolling?</code></td><td align="left"><code>boolean</code></td></tr><tr><td align="left"><a id="host"></a> <code>host?</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><a id="ignoreundefinedproperties"></a> <code>ignoreUndefinedProperties?</code></td><td align="left"><code>boolean</code></td></tr><tr><td align="left"><a id="localcache"></a> <code>localCache?</code></td><td align="left"><a href="#localcache-1"><code>LocalCache</code></a></td></tr><tr><td align="left"><a id="ssl"></a> <code>ssl?</code></td><td align="left"><code>boolean</code></td></tr></tbody></table></div>
|
|
1021
|
+
<hr>
|
|
1022
|
+
<p><a id="lintresult"></a></p>
|
|
1023
|
+
<h3 id="lintresult">LintResult</h3>
|
|
1024
|
+
<h4 id="properties-7">Properties</h4>
|
|
1025
|
+
<div class="table-scroll">
|
|
1026
|
+
|
|
1027
|
+
|
|
1028
|
+
|
|
1029
|
+
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Type</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left"><a id="metrics"></a> <code>metrics</code></td><td align="left"><a href="/docs/pyric-admin-firestore-reference-api/#rulesmetrics"><code>RulesMetrics</code></a></td><td align="left">-</td></tr><tr><td align="left"><a id="parseerror"></a> <code>parseError?</code></td><td align="left"><code>ParseError</code></td><td align="left">Structured parse failure when the source did not parse. When defined, <code>metrics</code> (except <code>sourceSize</code>) and <code>warnings</code> carry no signal — budget checks were skipped. Callers should branch on <code>parseError</code> before interpreting warnings or metrics. Why this isn’t a new <code>severity</code> value: a parse failure means “this isn’t a rule yet” rather than “this rule will fail at runtime”, which is a categorically different question from anything <code>warnings</code> answers. Adding a new severity would force every consumer to handle a third branch they don’t care about; a separate field lets old code keep working and gives new code a clean signal to check.</td></tr><tr><td align="left"><a id="warnings"></a> <code>warnings</code></td><td align="left"><a href="/docs/pyric-admin-firestore-reference-api/#lintwarning"><code>LintWarning</code></a>[]</td><td align="left">-</td></tr></tbody></table></div>
|
|
1051
|
+
<hr>
|
|
1052
|
+
<p><a id="localcache-1"></a></p>
|
|
1053
|
+
<h3 id="localcache">LocalCache</h3>
|
|
1054
|
+
<p>Opaque local-cache config token accepted by <a href="#initializefirestore">initializeFirestore</a>’s
|
|
1055
|
+
<code>settings.localCache</code>. Inert — see the tier-1 section rationale above.</p>
|
|
1056
|
+
<h4 id="properties-8">Properties</h4>
|
|
314
1057
|
<div class="table-scroll">
|
|
315
1058
|
|
|
316
1059
|
|
|
@@ -324,18 +1067,6 @@ Check behavioral conformance
|
|
|
324
1067
|
|
|
325
1068
|
|
|
326
1069
|
|
|
327
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>json</code></td><td align="left"><code>object</code></td></tr></tbody></table></div>
|
|
328
|
-
<h6 id="returns-20">Returns</h6>
|
|
329
|
-
<p><a href="#vectorvalue"><code>VectorValue</code></a></p>
|
|
330
|
-
<h2 id="interfaces">Interfaces</h2>
|
|
331
|
-
<p><a id="aggregatequerysnapshot"></a></p>
|
|
332
|
-
<h3 id="aggregatequerysnapshot">AggregateQuerySnapshot</h3>
|
|
333
|
-
<p>Snapshot returned by <code>getCountFromServer</code> /
|
|
334
|
-
<code>getAggregateFromServer</code>. <code>.data()</code> returns the computed numbers
|
|
335
|
-
keyed by the spec’s aliases (or <code>{ count: number }</code> for the
|
|
336
|
-
count-only entry point).</p>
|
|
337
|
-
<h4 id="type-parameters">Type Parameters</h4>
|
|
338
|
-
<div class="table-scroll">
|
|
339
1070
|
|
|
340
1071
|
|
|
341
1072
|
|
|
@@ -348,18 +1079,13 @@ count-only entry point).</p>
|
|
|
348
1079
|
|
|
349
1080
|
|
|
350
1081
|
|
|
351
|
-
<table><thead><tr><th align="left">
|
|
352
|
-
<h4 id="methods-4">Methods</h4>
|
|
353
|
-
<p><a id="data"></a></p>
|
|
354
|
-
<h5 id="data">data()</h5>
|
|
355
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">data</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
356
|
-
<h6 id="returns-21">Returns</h6>
|
|
357
|
-
<p><code>T</code></p>
|
|
1082
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="local_cache_symbol"></a> <code>[LOCAL_CACHE_SYMBOL]</code></td><td align="left"><code>readonly</code></td><td align="left"><code>"persistent"</code> | <code>"memory"</code></td></tr><tr><td align="left"><a id="garbagecollector"></a> <code>garbageCollector?</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#memorygarbagecollector"><code>MemoryGarbageCollector</code></a></td></tr><tr><td align="left"><a id="tabmanager"></a> <code>tabManager?</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#persistenttabmanager"><code>PersistentTabManager</code></a></td></tr></tbody></table></div>
|
|
358
1083
|
<hr>
|
|
359
|
-
<p><a id="
|
|
360
|
-
<h3 id="
|
|
361
|
-
<p>
|
|
362
|
-
|
|
1084
|
+
<p><a id="memorygarbagecollector"></a></p>
|
|
1085
|
+
<h3 id="memorygarbagecollector">MemoryGarbageCollector</h3>
|
|
1086
|
+
<p>Opaque garbage-collector config token. Inert for the same reason —
|
|
1087
|
+
there is no memory cache tier with GC pressure to tune.</p>
|
|
1088
|
+
<h4 id="properties-9">Properties</h4>
|
|
363
1089
|
<div class="table-scroll">
|
|
364
1090
|
|
|
365
1091
|
|
|
@@ -373,8 +1099,13 @@ count-only entry point).</p>
|
|
|
373
1099
|
|
|
374
1100
|
|
|
375
1101
|
|
|
376
|
-
|
|
377
|
-
|
|
1102
|
+
|
|
1103
|
+
|
|
1104
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="gc_symbol"></a> <code>[GC_SYMBOL]</code></td><td align="left"><code>readonly</code></td><td align="left"><code>"eager"</code> | <code>"lru"</code></td></tr></tbody></table></div>
|
|
1105
|
+
<hr>
|
|
1106
|
+
<p><a id="persistencesettings"></a></p>
|
|
1107
|
+
<h3 id="persistencesettings">PersistenceSettings</h3>
|
|
1108
|
+
<h4 id="properties-10">Properties</h4>
|
|
378
1109
|
<div class="table-scroll">
|
|
379
1110
|
|
|
380
1111
|
|
|
@@ -388,6 +1119,16 @@ count-only entry point).</p>
|
|
|
388
1119
|
|
|
389
1120
|
|
|
390
1121
|
|
|
1122
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="forceownership"></a> <code>forceOwnership?</code></td><td align="left"><code>boolean</code></td></tr></tbody></table></div>
|
|
1123
|
+
<hr>
|
|
1124
|
+
<p><a id="persistenttabmanager"></a></p>
|
|
1125
|
+
<h3 id="persistenttabmanager">PersistentTabManager</h3>
|
|
1126
|
+
<p>Opaque tab-manager config token. Inert — persistence is always on,
|
|
1127
|
+
and the SharedWorker/<code>pyric dev</code> path already is the one shared
|
|
1128
|
+
store every tab talks to, so there is no separate multi-tab mode
|
|
1129
|
+
to opt into. Carries the requested kind only for debugging.</p>
|
|
1130
|
+
<h4 id="properties-11">Properties</h4>
|
|
1131
|
+
<div class="table-scroll">
|
|
391
1132
|
|
|
392
1133
|
|
|
393
1134
|
|
|
@@ -395,13 +1136,6 @@ count-only entry point).</p>
|
|
|
395
1136
|
|
|
396
1137
|
|
|
397
1138
|
|
|
398
|
-
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="id"></a> <code>id</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><a id="path"></a> <code>path</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
399
|
-
<hr>
|
|
400
|
-
<p><a id="documentreference"></a></p>
|
|
401
|
-
<h3 id="documentreference">DocumentReference</h3>
|
|
402
|
-
<p>A reference to a Firestore document. Backend-opaque.</p>
|
|
403
|
-
<h4 id="type-parameters-2">Type Parameters</h4>
|
|
404
|
-
<div class="table-scroll">
|
|
405
1139
|
|
|
406
1140
|
|
|
407
1141
|
|
|
@@ -409,14 +1143,18 @@ count-only entry point).</p>
|
|
|
409
1143
|
|
|
410
1144
|
|
|
411
1145
|
|
|
1146
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="tab_manager_symbol"></a> <code>[TAB_MANAGER_SYMBOL]</code></td><td align="left"><code>readonly</code></td><td align="left"><code>"single"</code> | <code>"multiple"</code></td></tr></tbody></table></div>
|
|
1147
|
+
<hr>
|
|
1148
|
+
<p><a id="query"></a></p>
|
|
1149
|
+
<h3 id="query">Query</h3>
|
|
1150
|
+
<p>A Firestore query (a collection ref or one with where/orderBy/limit applied).</p>
|
|
1151
|
+
<h4 id="type-parameters-5">Type Parameters</h4>
|
|
1152
|
+
<div class="table-scroll">
|
|
412
1153
|
|
|
413
1154
|
|
|
414
1155
|
|
|
415
1156
|
|
|
416
1157
|
|
|
417
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>_T</code></td><td align="left"><a href="#authstate"><code>AuthState</code></a></td></tr></tbody></table></div>
|
|
418
|
-
<h4 id="properties-1">Properties</h4>
|
|
419
|
-
<div class="table-scroll">
|
|
420
1158
|
|
|
421
1159
|
|
|
422
1160
|
|
|
@@ -424,6 +1162,16 @@ count-only entry point).</p>
|
|
|
424
1162
|
|
|
425
1163
|
|
|
426
1164
|
|
|
1165
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>_T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
1166
|
+
<hr>
|
|
1167
|
+
<p><a id="queryconstraint"></a></p>
|
|
1168
|
+
<h3 id="queryconstraint">QueryConstraint</h3>
|
|
1169
|
+
<h4 id="methods-11">Methods</h4>
|
|
1170
|
+
<p><a id="applysandbox"></a></p>
|
|
1171
|
+
<h5 id="applysandbox">applySandbox()</h5>
|
|
1172
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">applySandbox</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">q</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">Query</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">Query</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1173
|
+
<h6 id="parameters-24">Parameters</h6>
|
|
1174
|
+
<div class="table-scroll">
|
|
427
1175
|
|
|
428
1176
|
|
|
429
1177
|
|
|
@@ -436,16 +1184,21 @@ count-only entry point).</p>
|
|
|
436
1184
|
|
|
437
1185
|
|
|
438
1186
|
|
|
439
|
-
<table><thead><tr><th align="left">
|
|
1187
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>q</code></td><td align="left"><a href="/docs/pyric-admin-firestore-reference-api/#query"><code>Query</code></a></td></tr></tbody></table></div>
|
|
1188
|
+
<h6 id="returns-45">Returns</h6>
|
|
1189
|
+
<p><a href="/docs/pyric-admin-firestore-reference-api/#query"><code>Query</code></a></p>
|
|
440
1190
|
<hr>
|
|
441
|
-
<p><a id="
|
|
442
|
-
<h3 id="
|
|
443
|
-
<p>
|
|
444
|
-
<
|
|
1191
|
+
<p><a id="querydocumentsnapshot"></a></p>
|
|
1192
|
+
<h3 id="querydocumentsnapshot">QueryDocumentSnapshot</h3>
|
|
1193
|
+
<p><code>QueryDocumentSnapshot</code> is a <code>DocumentSnapshot</code> known to exist —
|
|
1194
|
+
<code>.data()</code> always returns the typed model, never <code>undefined</code>. Yielded
|
|
1195
|
+
by <code>QuerySnapshot.docs</code> and passed to converter <code>fromFirestore</code>
|
|
1196
|
+
callbacks. Mirrors the JS SDK’s narrowing.</p>
|
|
1197
|
+
<h4 id="extends-1">Extends</h4>
|
|
445
1198
|
<ul>
|
|
446
|
-
<li><a href="#
|
|
1199
|
+
<li><a href="#documentsnapshot"><code>DocumentSnapshot</code></a><<code>T</code>></li>
|
|
447
1200
|
</ul>
|
|
448
|
-
<h4 id="type-parameters-
|
|
1201
|
+
<h4 id="type-parameters-6">Type Parameters</h4>
|
|
449
1202
|
<div class="table-scroll">
|
|
450
1203
|
|
|
451
1204
|
|
|
@@ -459,8 +1212,8 @@ count-only entry point).</p>
|
|
|
459
1212
|
|
|
460
1213
|
|
|
461
1214
|
|
|
462
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#
|
|
463
|
-
<h4 id="properties-
|
|
1215
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
1216
|
+
<h4 id="properties-12">Properties</h4>
|
|
464
1217
|
<div class="table-scroll">
|
|
465
1218
|
|
|
466
1219
|
|
|
@@ -481,18 +1234,20 @@ count-only entry point).</p>
|
|
|
481
1234
|
|
|
482
1235
|
|
|
483
1236
|
|
|
484
|
-
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="exists"></a> <code>exists</code></td><td align="left"><code>readonly</code></td><td align="left"><code>boolean</code> | () => <code>boolean</code></td></tr><tr><td align="left"><a id="id-
|
|
485
|
-
<h4 id="methods-
|
|
486
|
-
<p><a id="data-
|
|
487
|
-
<h5 id="data-
|
|
1237
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="exists-1"></a> <code>exists</code></td><td align="left"><code>readonly</code></td><td align="left"><code>boolean</code> | () => <code>boolean</code></td></tr><tr><td align="left"><a id="id-3"></a> <code>id</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
1238
|
+
<h4 id="methods-12">Methods</h4>
|
|
1239
|
+
<p><a id="data-4"></a></p>
|
|
1240
|
+
<h5 id="data-2">data()</h5>
|
|
488
1241
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">data</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
489
|
-
<h6 id="returns-
|
|
1242
|
+
<h6 id="returns-46">Returns</h6>
|
|
490
1243
|
<p><code>T</code></p>
|
|
1244
|
+
<h6 id="overrides-2">Overrides</h6>
|
|
1245
|
+
<p><a href="#documentsnapshot"><code>DocumentSnapshot</code></a>.<a href="#data-2"><code>data</code></a></p>
|
|
491
1246
|
<hr>
|
|
492
|
-
<p><a id="
|
|
493
|
-
<h3 id="
|
|
494
|
-
<p>
|
|
495
|
-
<h4 id="
|
|
1247
|
+
<p><a id="querysnapshot"></a></p>
|
|
1248
|
+
<h3 id="querysnapshot">QuerySnapshot</h3>
|
|
1249
|
+
<p>A point-in-time view of a query result.</p>
|
|
1250
|
+
<h4 id="type-parameters-7">Type Parameters</h4>
|
|
496
1251
|
<div class="table-scroll">
|
|
497
1252
|
|
|
498
1253
|
|
|
@@ -506,28 +1261,8 @@ count-only entry point).</p>
|
|
|
506
1261
|
|
|
507
1262
|
|
|
508
1263
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="target_symbol"></a> <code>[TARGET_SYMBOL]</code></td><td align="left"><code>readonly</code></td><td align="left"><code>Target</code></td></tr><tr><td align="left"><a id="app"></a> <code>app?</code></td><td align="left"><code>readonly</code></td><td align="left"><code>FirebaseApp</code></td></tr></tbody></table></div>
|
|
517
|
-
<hr>
|
|
518
|
-
<p><a id="firestoredataconverter"></a></p>
|
|
519
|
-
<h3 id="firestoredataconverter">FirestoreDataConverter</h3>
|
|
520
|
-
<p>Pair of translators between the consumer’s app model and the
|
|
521
|
-
underlying Firestore representation. Mirrors <code>firebase/firestore</code>’s
|
|
522
|
-
<code>FirestoreDataConverter</code> shape.</p>
|
|
523
|
-
<ul>
|
|
524
|
-
<li><code>toFirestore(model)</code> runs on every write (<code>setDoc</code>, <code>addDoc</code>)
|
|
525
|
-
through a converted ref. Returns the <code>DocumentData</code> to send.</li>
|
|
526
|
-
<li><code>fromFirestore(snapshot)</code> runs on every read (<code>getDoc</code>,
|
|
527
|
-
<code>getDocs</code>, snapshot listener callback) through a converted ref.
|
|
528
|
-
Receives the raw snapshot, returns the typed model.</li>
|
|
529
|
-
</ul>
|
|
530
|
-
<h4 id="type-parameters-4">Type Parameters</h4>
|
|
1264
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
1265
|
+
<h4 id="properties-13">Properties</h4>
|
|
531
1266
|
<div class="table-scroll">
|
|
532
1267
|
|
|
533
1268
|
|
|
@@ -545,17 +1280,6 @@ Receives the raw snapshot, returns the typed model.</li>
|
|
|
545
1280
|
|
|
546
1281
|
|
|
547
1282
|
|
|
548
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>AppModelType</code></td><td align="left">-</td></tr><tr><td align="left"><code>DbModelType</code> <em>extends</em> <a href="#authstate"><code>AuthState</code></a></td><td align="left"><a href="#authstate"><code>AuthState</code></a></td></tr></tbody></table></div>
|
|
549
|
-
<h4 id="methods-6">Methods</h4>
|
|
550
|
-
<p><a id="fromfirestore"></a></p>
|
|
551
|
-
<h5 id="fromfirestore">fromFirestore()</h5>
|
|
552
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">fromFirestore</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">snapshot</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">QueryDocumentSnapshot</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">DbModelType</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">AppModelType</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
553
|
-
<h6 id="parameters-12">Parameters</h6>
|
|
554
|
-
<div class="table-scroll">
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
1283
|
|
|
560
1284
|
|
|
561
1285
|
|
|
@@ -564,13 +1288,22 @@ Receives the raw snapshot, returns the typed model.</li>
|
|
|
564
1288
|
|
|
565
1289
|
|
|
566
1290
|
|
|
567
|
-
<table><thead><tr><th align="left">
|
|
568
|
-
<
|
|
569
|
-
<p><
|
|
570
|
-
<
|
|
571
|
-
<
|
|
572
|
-
<
|
|
573
|
-
|
|
1291
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="docs"></a> <code>docs</code></td><td align="left"><code>readonly</code></td><td align="left">readonly <a href="#querydocumentsnapshot"><code>QueryDocumentSnapshot</code></a><<code>T</code>>[]</td></tr><tr><td align="left"><a id="empty"></a> <code>empty</code></td><td align="left"><code>readonly</code></td><td align="left"><code>boolean</code></td></tr><tr><td align="left"><a id="size"></a> <code>size</code></td><td align="left"><code>readonly</code></td><td align="left"><code>number</code></td></tr></tbody></table></div>
|
|
1292
|
+
<hr>
|
|
1293
|
+
<p><a id="sandbox"></a></p>
|
|
1294
|
+
<h3 id="sandbox">Sandbox</h3>
|
|
1295
|
+
<p>A Firebase sandbox — an isolated environment with one auth identity.</p>
|
|
1296
|
+
<p>Created via <code>initializeSandbox(config)</code>. Use <code>fork({ auth })</code> to
|
|
1297
|
+
derive a new sandbox with a different identity that shares the
|
|
1298
|
+
underlying environment (rules, data, state). Fork is the only
|
|
1299
|
+
identity-switching mechanism — there are no per-op auth overrides
|
|
1300
|
+
and no in-place mutation.</p>
|
|
1301
|
+
<h4 id="extended-by-1">Extended by</h4>
|
|
1302
|
+
<ul>
|
|
1303
|
+
<li><a href="/docs/pyric-sandbox-reference-api/#localsandbox"><code>LocalSandbox</code></a></li>
|
|
1304
|
+
<li><a href="/docs/pyric-sandbox-reference-api/#remotesandbox"><code>RemoteSandbox</code></a></li>
|
|
1305
|
+
</ul>
|
|
1306
|
+
<h4 id="properties-14">Properties</h4>
|
|
574
1307
|
<div class="table-scroll">
|
|
575
1308
|
|
|
576
1309
|
|
|
@@ -584,27 +1317,6 @@ Receives the raw snapshot, returns the typed model.</li>
|
|
|
584
1317
|
|
|
585
1318
|
|
|
586
1319
|
|
|
587
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>modelObject</code></td><td align="left"><code>AppModelType</code></td></tr></tbody></table></div>
|
|
588
|
-
<h6 id="returns-24">Returns</h6>
|
|
589
|
-
<p><code>DbModelType</code></p>
|
|
590
|
-
<hr>
|
|
591
|
-
<p><a id="firestoredatatooldeps"></a></p>
|
|
592
|
-
<h3 id="firestoredatatooldeps">FirestoreDataToolDeps</h3>
|
|
593
|
-
<h4 id="methods-7">Methods</h4>
|
|
594
|
-
<p><a id="resolvedb"></a></p>
|
|
595
|
-
<h5 id="resolvedb">resolveDb()</h5>
|
|
596
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">resolveDb</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">as</span><span style="color:#C678DD">?:</span><span style="color:#E06C75"> As</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">Firestore</span><span style="color:#56B6C2"> |</span><span style="color:#E5C07B"> Promise</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">Firestore</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
597
|
-
<p>Resolver returning a <code>Firestore</code> handle. Called per-dispatch with the
|
|
598
|
-
op’s <code>as</code> value: <code>'admin'</code> (or undefined) → an admin-bypass Firestore;
|
|
599
|
-
<code>{ uid, claims? }</code> → a rules-enforcing Firestore acting as that user.</p>
|
|
600
|
-
<p>The host decides the posture; the tool layer does NOT enforce it. A sandbox
|
|
601
|
-
resolver may default to admin (rules bypass is the point of seeding), but a
|
|
602
|
-
resolver wired to a real backend should require an explicit identity or
|
|
603
|
-
confirm-gate admin writes (see the bridge’s prod confirm-policy).</p>
|
|
604
|
-
<h6 id="parameters-14">Parameters</h6>
|
|
605
|
-
<div class="table-scroll">
|
|
606
|
-
|
|
607
|
-
|
|
608
1320
|
|
|
609
1321
|
|
|
610
1322
|
|
|
@@ -615,26 +1327,6 @@ confirm-gate admin writes (see the bridge’s prod confirm-policy).</p>
|
|
|
615
1327
|
|
|
616
1328
|
|
|
617
1329
|
|
|
618
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>as?</code></td><td align="left"><a href="#as"><code>As</code></a></td></tr></tbody></table></div>
|
|
619
|
-
<h6 id="returns-25">Returns</h6>
|
|
620
|
-
<p><a href="#firestore"><code>Firestore</code></a> | <code>Promise</code><<a href="#firestore"><code>Firestore</code></a>></p>
|
|
621
|
-
<hr>
|
|
622
|
-
<p><a id="firestoreinspecttooldeps"></a></p>
|
|
623
|
-
<h3 id="firestoreinspecttooldeps">FirestoreInspectToolDeps</h3>
|
|
624
|
-
<h4 id="methods-8">Methods</h4>
|
|
625
|
-
<p><a id="resolvesandbox"></a></p>
|
|
626
|
-
<h5 id="resolvesandbox">resolveSandbox()</h5>
|
|
627
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">resolveSandbox</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">any</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
628
|
-
<p>Resolve the sandbox whose Firestore state should be inspected.</p>
|
|
629
|
-
<h6 id="returns-26">Returns</h6>
|
|
630
|
-
<p><code>any</code></p>
|
|
631
|
-
<hr>
|
|
632
|
-
<p><a id="firestoresettings"></a></p>
|
|
633
|
-
<h3 id="firestoresettings">FirestoreSettings</h3>
|
|
634
|
-
<p>Client-cache/network settings <code>initializeFirestore</code> accepts but no-ops
|
|
635
|
-
on sandbox targets — see the tier-1 section rationale above.</p>
|
|
636
|
-
<h4 id="properties-4">Properties</h4>
|
|
637
|
-
<div class="table-scroll">
|
|
638
1330
|
|
|
639
1331
|
|
|
640
1332
|
|
|
@@ -647,6 +1339,49 @@ on sandbox targets — see the tier-1 section rationale above.</p>
|
|
|
647
1339
|
|
|
648
1340
|
|
|
649
1341
|
|
|
1342
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left"><a id="admin"></a> <code>admin</code></td><td align="left"><code>readonly</code></td><td align="left"><code>SandboxAdmin</code></td><td align="left">Admin-plane access (rule-bypass reads). Identity-agnostic by design — admin reads aren’t gated on auth, so they live on the sandbox, not on a context. See SandboxAdmin.</td></tr><tr><td align="left"><a id="currentuser"></a> <code>currentUser</code></td><td align="left"><code>public</code></td><td align="left">{ <code>token?</code>: <code>Record</code><<code>string</code>, <code>unknown</code>>; <code>uid</code>: <code>string</code>; }</td><td align="left">Current authenticated user across the sandbox. Mutated by <code>pyric/auth</code>’s <code>signInAnonymously</code> / <code>signInWithEmailAndPassword</code> / <code>signOut</code> / <code>sandbox.setUser</code>. Read per-call by service factories (e.g. a future <code>getFirestore(sandbox)</code> overload) so they see auth state changes without re-binding handles. Defaults to <code>null</code> (anonymous / signed out). <strong>Independent of <code>withAuth({uid})</code></strong> — <code>withAuth</code> still produces a frozen <a href="#sandboxcontext">SandboxContext</a> that carries its own identity for the runner’s test code (the existing pattern: explicit identity per service call). <code>currentUser</code> exists for the <code>pyric/auth</code> mirror, where consumer app code drives identity through a stateful <code>Auth</code> handle rather than naming it per call.</td></tr><tr><td align="left"><code>currentUser.token?</code></td><td align="left"><code>public</code></td><td align="left"><code>Record</code><<code>string</code>, <code>unknown</code>></td><td align="left">-</td></tr><tr><td align="left"><code>currentUser.uid</code></td><td align="left"><code>public</code></td><td align="left"><code>string</code></td><td align="left">-</td></tr></tbody></table></div>
|
|
1343
|
+
<h4 id="methods-13">Methods</h4>
|
|
1344
|
+
<p><a id="clearpersistence"></a></p>
|
|
1345
|
+
<h5 id="clearpersistence">clearPersistence()</h5>
|
|
1346
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">clearPersistence</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1347
|
+
<p>Wipe the persisted blob for this sandbox’s <code>key</code>. In-memory state
|
|
1348
|
+
is left intact — call <code>reset()</code> if you want both. Useful for
|
|
1349
|
+
“sign out and forget” flows.</p>
|
|
1350
|
+
<p>No-op when persistence is not enabled.</p>
|
|
1351
|
+
<h6 id="returns-47">Returns</h6>
|
|
1352
|
+
<p><code>Promise</code><<code>void</code>></p>
|
|
1353
|
+
<p><a id="dispose"></a></p>
|
|
1354
|
+
<h5 id="dispose">dispose()</h5>
|
|
1355
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">dispose</span><span style="color:#ABB2BF">(): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1356
|
+
<p>Tear down listener registries on this sandbox’s environment without
|
|
1357
|
+
replacing it. Use this when you’re about to discard the sandbox
|
|
1358
|
+
itself (e.g. <code>runner.reseed()</code> builds a fresh sandbox rather than
|
|
1359
|
+
calling <code>reset()</code>) and want to drop callback references on the
|
|
1360
|
+
outgoing instance defensively. Idempotent. Does not touch data.</p>
|
|
1361
|
+
<h6 id="returns-48">Returns</h6>
|
|
1362
|
+
<p><code>void</code></p>
|
|
1363
|
+
<p><a id="enablepersistence"></a></p>
|
|
1364
|
+
<h5 id="enablepersistence">enablePersistence()</h5>
|
|
1365
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">enablePersistence</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">options</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">SandboxPersistenceOptions</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1366
|
+
<p>Persist the sandbox’s data to a backend and restore it on next
|
|
1367
|
+
<code>enablePersistence</code> call. The default <code>'indexedDB'</code> backend turns
|
|
1368
|
+
the sandbox into the host page’s local Firestore — writes flush
|
|
1369
|
+
automatically and a fresh <code>initializeSandbox()</code> rehydrates from
|
|
1370
|
+
the prior session.</p>
|
|
1371
|
+
<p>Restoration happens before the promise resolves; awaiting this
|
|
1372
|
+
call is sufficient to guarantee in-memory state matches the
|
|
1373
|
+
persisted blob.</p>
|
|
1374
|
+
<p>Idempotent across the same <code>key</code> — calling twice in one process
|
|
1375
|
+
is a no-op on the second call. Different keys are rejected as an
|
|
1376
|
+
error (a sandbox can persist to at most one backend at a time).</p>
|
|
1377
|
+
<p>Listener semantics: every write event the sandbox emits triggers
|
|
1378
|
+
a debounced flush (default 250ms). Browser hosts additionally
|
|
1379
|
+
flush on <code>beforeunload</code> so a page navigation doesn’t lose the
|
|
1380
|
+
tail of the debounce window.</p>
|
|
1381
|
+
<p>See <a href="/docs/pyric-sandbox-reference-api/#sandboxpersistenceoptions">SandboxPersistenceOptions</a> for backend selection and
|
|
1382
|
+
tuning.</p>
|
|
1383
|
+
<h6 id="parameters-25">Parameters</h6>
|
|
1384
|
+
<div class="table-scroll">
|
|
650
1385
|
|
|
651
1386
|
|
|
652
1387
|
|
|
@@ -659,6 +1394,28 @@ on sandbox targets — see the tier-1 section rationale above.</p>
|
|
|
659
1394
|
|
|
660
1395
|
|
|
661
1396
|
|
|
1397
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>options</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#sandboxpersistenceoptions"><code>SandboxPersistenceOptions</code></a></td></tr></tbody></table></div>
|
|
1398
|
+
<h6 id="returns-49">Returns</h6>
|
|
1399
|
+
<p><code>Promise</code><<code>void</code>></p>
|
|
1400
|
+
<p><a id="enabletabsync"></a></p>
|
|
1401
|
+
<h5 id="enabletabsync">enableTabSync()</h5>
|
|
1402
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">enableTabSync</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">options</span><span style="color:#C678DD">?:</span><span style="color:#E06C75"> TabSyncOptions</span><span style="color:#ABB2BF">): () </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1403
|
+
<p>Enable cross-tab realtime sync via <code>BroadcastChannel</code>. A write in
|
|
1404
|
+
this tab will propagate to every OTHER tab of the same origin that
|
|
1405
|
+
also called <code>enableTabSync</code>, causing their <code>onSnapshot</code> listeners to
|
|
1406
|
+
re-evaluate — restoring production’s cross-client realtime behavior.</p>
|
|
1407
|
+
<p><strong>Opt-in, OFF by default.</strong> Firestore only (RTDB is a follow-on).</p>
|
|
1408
|
+
<p>Returns a disable function. Calling it removes the <code>onEvent</code>
|
|
1409
|
+
subscription, the channel message listener, and closes the channel
|
|
1410
|
+
(when it was created internally). After disable, no further propagation
|
|
1411
|
+
occurs in either direction.</p>
|
|
1412
|
+
<p><strong>Multi-writer note:</strong> concurrent writes from two tabs to the same doc
|
|
1413
|
+
produce last-write-wins divergence — there is no conflict resolution.
|
|
1414
|
+
The intended model is one active writer (one user, one tab) with
|
|
1415
|
+
observers in other tabs; this covers the overwhelming majority of
|
|
1416
|
+
local development scenarios.</p>
|
|
1417
|
+
<h6 id="parameters-26">Parameters</h6>
|
|
1418
|
+
<div class="table-scroll">
|
|
662
1419
|
|
|
663
1420
|
|
|
664
1421
|
|
|
@@ -671,13 +1428,62 @@ on sandbox targets — see the tier-1 section rationale above.</p>
|
|
|
671
1428
|
|
|
672
1429
|
|
|
673
1430
|
|
|
674
|
-
<table><thead><tr><th align="left">
|
|
675
|
-
<
|
|
676
|
-
<
|
|
677
|
-
<
|
|
678
|
-
<p>
|
|
679
|
-
<
|
|
680
|
-
<
|
|
1431
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>options?</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#tabsyncoptions"><code>TabSyncOptions</code></a></td></tr></tbody></table></div>
|
|
1432
|
+
<h6 id="returns-50">Returns</h6>
|
|
1433
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1434
|
+
<h6 id="returns-51">Returns</h6>
|
|
1435
|
+
<p><code>void</code></p>
|
|
1436
|
+
<h6 id="see">See</h6>
|
|
1437
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#tabsyncoptions">TabSyncOptions</a> for channel injection (tests) and originId.</p>
|
|
1438
|
+
<h6 id="example">Example</h6>
|
|
1439
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#7F848E;font-style:italic">// In every tab that should participate in realtime:</span></span>
|
|
1440
|
+
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> sandbox</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> initializeSandbox</span><span style="color:#ABB2BF">();</span></span>
|
|
1441
|
+
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> disableSync</span><span style="color:#56B6C2"> =</span><span style="color:#E5C07B"> sandbox</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">enableTabSync</span><span style="color:#ABB2BF">();</span></span>
|
|
1442
|
+
<span class="line"><span style="color:#7F848E;font-style:italic">// Later, to stop syncing:</span></span>
|
|
1443
|
+
<span class="line"><span style="color:#61AFEF">disableSync</span><span style="color:#ABB2BF">();</span></span></code></pre>
|
|
1444
|
+
<p><a id="flush"></a></p>
|
|
1445
|
+
<h5 id="flush">flush()</h5>
|
|
1446
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">flush</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2"><</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1447
|
+
<p>Force a snapshot to the configured persistence backend right now.
|
|
1448
|
+
Useful before a manual navigation, or in tests that need
|
|
1449
|
+
deterministic ordering against the debounce window. Resolves once
|
|
1450
|
+
the write hits the backend.</p>
|
|
1451
|
+
<p>Throws if persistence is not enabled.</p>
|
|
1452
|
+
<h6 id="returns-52">Returns</h6>
|
|
1453
|
+
<p><code>Promise</code><<code>void</code>></p>
|
|
1454
|
+
<p><a id="history"></a></p>
|
|
1455
|
+
<h5 id="history">history()</h5>
|
|
1456
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">history</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">SandboxEvent</span><span style="color:#ABB2BF">[];</span></span></code></pre>
|
|
1457
|
+
<p>Every <a href="/docs/pyric-sandbox-reference-api/#sandboxevent">SandboxEvent</a> this sandbox has emitted since init or
|
|
1458
|
+
the last <code>reset()</code>. Returns a defensive copy.</p>
|
|
1459
|
+
<p>Use this for replay: hand the array to <code>replay(events, rules)</code>
|
|
1460
|
+
from <code>pyric/sandbox</code> and the engine re-issues every
|
|
1461
|
+
captured write against a fresh sandbox.</p>
|
|
1462
|
+
<p>Unlike <a href="#onevent">onEvent</a> (live stream from the moment of subscribe),
|
|
1463
|
+
<code>history()</code> returns <em>every</em> event the sandbox has seen — useful
|
|
1464
|
+
for consumers that attach late (e.g., loading a saved session
|
|
1465
|
+
before subscribing) or that need a snapshot at a particular moment.</p>
|
|
1466
|
+
<p><code>reset()</code> and <code>dispose()</code> each append a closing <code>session_boundary</code>
|
|
1467
|
+
event; <code>reset()</code> then clears the history. Consumers that took a
|
|
1468
|
+
snapshot <em>before</em> reset retain the boundary in their copy.</p>
|
|
1469
|
+
<h6 id="returns-53">Returns</h6>
|
|
1470
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#sandboxevent"><code>SandboxEvent</code></a>[]</p>
|
|
1471
|
+
<p><a id="loadsnapshot"></a></p>
|
|
1472
|
+
<h5 id="loadsnapshot">loadSnapshot()</h5>
|
|
1473
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">loadSnapshot</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">data</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">SandboxSnapshot</span><span style="color:#ABB2BF">): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1474
|
+
<p>CLOBBER-restore the sandbox’s entire state from a prior <a href="#snapshot">snapshot</a>:
|
|
1475
|
+
<code>reset()</code> (clears firestore + the signed-in session), then rebuild firestore
|
|
1476
|
+
from <code>data</code> and restore each registered service. This is a TOTAL replace —
|
|
1477
|
+
documents absent from <code>data</code> do NOT survive — and is the counterpart to
|
|
1478
|
+
<a href="#snapshot">snapshot</a>. It is what makes “transfer (clobber) one instance’s data
|
|
1479
|
+
into another” and named-branch switching possible.</p>
|
|
1480
|
+
<p>Fires a <code>session_boundary</code> (reset phase), re-evaluates live listeners against
|
|
1481
|
+
the loaded state, and the next persistence flush writes the loaded state.
|
|
1482
|
+
Services present in <code>data</code> but not currently registered are skipped (a
|
|
1483
|
+
snapshot taken via <a href="#snapshot">snapshot</a> always includes every registered
|
|
1484
|
+
service, so this only affects cross-instance imports from a sandbox that had
|
|
1485
|
+
a service this one lacks).</p>
|
|
1486
|
+
<h6 id="parameters-27">Parameters</h6>
|
|
681
1487
|
<div class="table-scroll">
|
|
682
1488
|
|
|
683
1489
|
|
|
@@ -691,6 +1497,26 @@ on sandbox targets — see the tier-1 section rationale above.</p>
|
|
|
691
1497
|
|
|
692
1498
|
|
|
693
1499
|
|
|
1500
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>data</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#sandboxsnapshot"><code>SandboxSnapshot</code></a></td></tr></tbody></table></div>
|
|
1501
|
+
<h6 id="returns-54">Returns</h6>
|
|
1502
|
+
<p><code>void</code></p>
|
|
1503
|
+
<p><a id="oncurrentuserchanged"></a></p>
|
|
1504
|
+
<h5 id="oncurrentuserchanged">onCurrentUserChanged()</h5>
|
|
1505
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">onCurrentUserChanged</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">cb</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">user</span><span style="color:#ABB2BF">: {</span></span>
|
|
1506
|
+
<span class="line"><span style="color:#E06C75"> token</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Record</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">>;</span></span>
|
|
1507
|
+
<span class="line"><span style="color:#E06C75"> uid</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">;</span></span>
|
|
1508
|
+
<span class="line"><span style="color:#ABB2BF">}) </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">): () </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1509
|
+
<p>Subscribe to <code>currentUser</code> changes. Fires on every mutation —
|
|
1510
|
+
sign-in, sign-out, user swap. Does NOT fire on subscribe.</p>
|
|
1511
|
+
<p>Survives <code>reset()</code> and <code>dispose()</code> only as a no-op: a disposed
|
|
1512
|
+
sandbox emits nothing further; a reset sandbox clears
|
|
1513
|
+
<code>currentUser</code> to <code>null</code> (and fires the change) before swapping
|
|
1514
|
+
the env.</p>
|
|
1515
|
+
<p>Returns an unsubscribe function. Listener errors are swallowed —
|
|
1516
|
+
subscribers are observational, the sandbox does not propagate
|
|
1517
|
+
their errors.</p>
|
|
1518
|
+
<h6 id="parameters-28">Parameters</h6>
|
|
1519
|
+
<div class="table-scroll">
|
|
694
1520
|
|
|
695
1521
|
|
|
696
1522
|
|
|
@@ -703,13 +1529,35 @@ on sandbox targets — see the tier-1 section rationale above.</p>
|
|
|
703
1529
|
|
|
704
1530
|
|
|
705
1531
|
|
|
706
|
-
<table><thead><tr><th align="left">
|
|
707
|
-
<
|
|
708
|
-
<
|
|
709
|
-
<
|
|
710
|
-
<p>
|
|
711
|
-
|
|
712
|
-
<
|
|
1532
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>cb</code></td><td align="left">(<code>user</code>: { <code>token?</code>: <code>Record</code><<code>string</code>, <code>unknown</code>>; <code>uid</code>: <code>string</code>; }) => <code>void</code></td></tr></tbody></table></div>
|
|
1533
|
+
<h6 id="returns-55">Returns</h6>
|
|
1534
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1535
|
+
<h6 id="returns-56">Returns</h6>
|
|
1536
|
+
<p><code>void</code></p>
|
|
1537
|
+
<p><a id="onevent"></a></p>
|
|
1538
|
+
<h5 id="onevent">onEvent()</h5>
|
|
1539
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">onEvent</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">cb</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">event</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">SandboxEvent</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">): () </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1540
|
+
<p>Subscribe to every event the sandbox emits — see <a href="/docs/pyric-sandbox-reference-api/#sandboxevent">SandboxEvent</a>
|
|
1541
|
+
for the discriminated-union shape. One subscription covers
|
|
1542
|
+
request/denial/snapshot-error/listener-lifecycle/session-boundary;
|
|
1543
|
+
filter on <code>event.kind</code> to recover individual streams.</p>
|
|
1544
|
+
<p>Replaces the prior three-channel surface (<code>onRequest</code> / <code>onDenial</code>
|
|
1545
|
+
/ <code>onSnapshotError</code>) — see issue #307. Filter cookbook:</p>
|
|
1546
|
+
<ul>
|
|
1547
|
+
<li>All denials: <code>event.kind === 'request' && event.result === 'deny'</code></li>
|
|
1548
|
+
<li>Stream errors: <code>event.kind === 'listener_errored'</code></li>
|
|
1549
|
+
<li>Per-op traffic: <code>event.kind === 'request'</code></li>
|
|
1550
|
+
</ul>
|
|
1551
|
+
<p>Survives <code>sandbox.reset()</code> — the subscription is held on the
|
|
1552
|
+
sandbox, not on the underlying environment. A <code>session_boundary</code>
|
|
1553
|
+
event with <code>phase: 'reset'</code> fires before the env swap so consumers
|
|
1554
|
+
can segment their stream.</p>
|
|
1555
|
+
<p>Returns an unsubscribe function. Listener errors are swallowed so a
|
|
1556
|
+
faulty subscriber can’t change rule semantics or hide other events.
|
|
1557
|
+
Both synchronous throws and rejected Promises from async callbacks
|
|
1558
|
+
are silently discarded — subscribers are <strong>observational</strong>, the
|
|
1559
|
+
sandbox doesn’t await them and doesn’t propagate their errors.</p>
|
|
1560
|
+
<h6 id="parameters-29">Parameters</h6>
|
|
713
1561
|
<div class="table-scroll">
|
|
714
1562
|
|
|
715
1563
|
|
|
@@ -723,13 +1571,31 @@ there is no memory cache tier with GC pressure to tune.</p>
|
|
|
723
1571
|
|
|
724
1572
|
|
|
725
1573
|
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
<
|
|
729
|
-
<
|
|
730
|
-
<p><
|
|
731
|
-
<
|
|
732
|
-
<
|
|
1574
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>cb</code></td><td align="left">(<code>event</code>: <a href="/docs/pyric-sandbox-reference-api/#sandboxevent"><code>SandboxEvent</code></a>) => <code>void</code></td></tr></tbody></table></div>
|
|
1575
|
+
<h6 id="returns-57">Returns</h6>
|
|
1576
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1577
|
+
<h6 id="returns-58">Returns</h6>
|
|
1578
|
+
<p><code>void</code></p>
|
|
1579
|
+
<p><a id="registerpersistableservice"></a></p>
|
|
1580
|
+
<h5 id="registerpersistableservice">registerPersistableService()</h5>
|
|
1581
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">registerPersistableService</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">name</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">hooks</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">PersistableService</span><span style="color:#ABB2BF">): () </span><span style="color:#C678DD">=></span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1582
|
+
<p>Register a service (auth, storage, …) as a persistence participant.
|
|
1583
|
+
The sandbox calls <code>hooks.snapshot()</code> on every flush and
|
|
1584
|
+
<code>hooks.restore(data)</code> on restore. If <code>hooks.subscribe</code> is provided,
|
|
1585
|
+
the persistence controller subscribes and schedules a debounced
|
|
1586
|
+
flush on each change — so auth-user edits flush promptly, not only
|
|
1587
|
+
on the next Firestore write.</p>
|
|
1588
|
+
<p>Returns an unregister function — call it if the service is torn
|
|
1589
|
+
down before the sandbox is disposed (uncommon in practice; the
|
|
1590
|
+
sandbox’s <code>dispose()</code> clears the registry anyway).</p>
|
|
1591
|
+
<p>Throws <code>failed-precondition</code> when a service with the same <code>name</code> is
|
|
1592
|
+
already registered — the auth package registers <code>'auth'</code> once when
|
|
1593
|
+
<code>getAuth(sandbox)</code> first creates a backend, so accidental double-
|
|
1594
|
+
registration is a caller bug, not a no-op.</p>
|
|
1595
|
+
<p><strong>Advanced / internal API.</strong> Service packages (auth, storage) call
|
|
1596
|
+
this when they first attach to a sandbox. Consumer app code should
|
|
1597
|
+
not need to call this directly.</p>
|
|
1598
|
+
<h6 id="parameters-30">Parameters</h6>
|
|
733
1599
|
<div class="table-scroll">
|
|
734
1600
|
|
|
735
1601
|
|
|
@@ -743,20 +1609,75 @@ there is no memory cache tier with GC pressure to tune.</p>
|
|
|
743
1609
|
|
|
744
1610
|
|
|
745
1611
|
|
|
746
|
-
<table><thead><tr><th align="left">Property</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="forceownership"></a> <code>forceOwnership?</code></td><td align="left"><code>boolean</code></td></tr></tbody></table></div>
|
|
747
|
-
<hr>
|
|
748
|
-
<p><a id="persistenttabmanager"></a></p>
|
|
749
|
-
<h3 id="persistenttabmanager">PersistentTabManager</h3>
|
|
750
|
-
<p>Opaque tab-manager config token. Inert — persistence is always on,
|
|
751
|
-
and the SharedWorker/<code>pyric dev</code> path already is the one shared
|
|
752
|
-
store every tab talks to, so there is no separate multi-tab mode
|
|
753
|
-
to opt into. Carries the requested kind only for debugging.</p>
|
|
754
|
-
<h4 id="properties-8">Properties</h4>
|
|
755
|
-
<div class="table-scroll">
|
|
756
1612
|
|
|
757
1613
|
|
|
758
1614
|
|
|
759
1615
|
|
|
1616
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>name</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><code>hooks</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#persistableservice"><code>PersistableService</code></a></td></tr></tbody></table></div>
|
|
1617
|
+
<h6 id="returns-59">Returns</h6>
|
|
1618
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1619
|
+
<h6 id="returns-60">Returns</h6>
|
|
1620
|
+
<p><code>void</code></p>
|
|
1621
|
+
<p><a id="reset"></a></p>
|
|
1622
|
+
<h5 id="reset">reset()</h5>
|
|
1623
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">reset</span><span style="color:#ABB2BF">(): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1624
|
+
<p>Reset the underlying environment to a fresh state — wipes data,
|
|
1625
|
+
rules, and any service-specific configuration.</p>
|
|
1626
|
+
<p>Snapshot listeners attached to the OLD environment are dropped at
|
|
1627
|
+
the swap — they can’t survive because their target docs have been
|
|
1628
|
+
wiped. <code>onEvent</code> subscribers DO survive — the registry lives on
|
|
1629
|
+
the sandbox, and a <code>session_boundary</code> event with <code>phase: 'reset'</code>
|
|
1630
|
+
fires before the swap so subscribers know the rollover happened.
|
|
1631
|
+
Existing <a href="#sandboxcontext">SandboxContext</a>s continue to work — their sandbox
|
|
1632
|
+
reference is stable; subsequent operations resolve to the new env.</p>
|
|
1633
|
+
<h6 id="returns-61">Returns</h6>
|
|
1634
|
+
<p><code>void</code></p>
|
|
1635
|
+
<p><a id="resetall"></a></p>
|
|
1636
|
+
<h5 id="resetall">resetAll()</h5>
|
|
1637
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">resetAll</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF"><{</span></span>
|
|
1638
|
+
<span class="line"><span style="color:#E06C75"> errors</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">[];</span></span>
|
|
1639
|
+
<span class="line"><span style="color:#ABB2BF">}>;</span></span></code></pre>
|
|
1640
|
+
<p>Reset the WHOLE sandbox: <a href="#reset">reset</a> (Firestore env + signed-in
|
|
1641
|
+
session), then clear every registered persistable service that
|
|
1642
|
+
provides a <a href="/docs/pyric-sandbox-reference-api/#reset-2">PersistableService.reset</a> hook — auth users, the
|
|
1643
|
+
RTDB tree, storage objects. This is the one sandbox-owned “wipe
|
|
1644
|
+
everything” path: because it iterates the service registry, a new
|
|
1645
|
+
service that registers with a <code>reset</code> hook is cleared automatically,
|
|
1646
|
+
and a consumer (Pyric Studio’s reset) cannot forget one.</p>
|
|
1647
|
+
<p>Service resets may be async (storage clears IndexedDB stores); the
|
|
1648
|
+
returned promise resolves when every service has finished clearing.
|
|
1649
|
+
A service whose <code>reset</code> throws is isolated (others still clear) and
|
|
1650
|
+
REPORTED in the returned <code>errors</code> (as <code>name: message</code>) — a reset that
|
|
1651
|
+
leaves data behind must never look successful to the caller.</p>
|
|
1652
|
+
<h6 id="returns-62">Returns</h6>
|
|
1653
|
+
<p><code>Promise</code><{
|
|
1654
|
+
<code>errors</code>: <code>string</code>[];
|
|
1655
|
+
}></p>
|
|
1656
|
+
<p><a id="runwithprovenance"></a></p>
|
|
1657
|
+
<h5 id="runwithprovenance">runWithProvenance()?</h5>
|
|
1658
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#E06C75">optional</span><span style="color:#61AFEF"> runWithProvenance</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75">provenance</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">EventProvenance</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">fn</span><span style="color:#ABB2BF">: () </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> T</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1659
|
+
<p>Run <code>fn</code> with ambient <a href="/docs/pyric-sandbox-reference-api/#eventprovenance">EventProvenance</a> defaults: every event
|
|
1660
|
+
emitted SYNCHRONOUSLY during <code>fn</code> that doesn’t already carry a
|
|
1661
|
+
provenance field (on the event itself or via an explicit per-emit
|
|
1662
|
+
override) is stamped with these values instead of the global
|
|
1663
|
+
defaults. This is the mechanical “who issued this op” seam the
|
|
1664
|
+
serve worker uses to tag Studio-issued ops (<code>actor: { kind: 'studio' }</code>) and to stamp the auth lens an op ran under
|
|
1665
|
+
(<code>authLens</code>) — declared by the caller that issues the op, never
|
|
1666
|
+
inferred from the op’s shape.</p>
|
|
1667
|
+
<p>SYNCHRONOUS WINDOW: the ambient values apply only until <code>fn</code>
|
|
1668
|
+
returns (for an async <code>fn</code>, its synchronous prefix — which covers
|
|
1669
|
+
the local environment’s rules eval + event emission, since those
|
|
1670
|
+
run before the op’s promise is handed back). Work an op DEFERS
|
|
1671
|
+
(snapshot-listener deliveries and re-evals drain on a microtask,
|
|
1672
|
+
off-stack) is intentionally OUTSIDE the window: a listener re-eval
|
|
1673
|
+
belongs to the listener’s owner, not to whoever’s write triggered
|
|
1674
|
+
it. Nested calls stack — the innermost window wins per field, and
|
|
1675
|
+
each window restores the previous one on exit (including on throw).</p>
|
|
1676
|
+
<p>OPTIONAL because remote sandbox proxies can’t provide an ambient
|
|
1677
|
+
emit window (events are emitted in the worker they front). Callers
|
|
1678
|
+
spell <code>sandbox.runWithProvenance?.(prov, fn) ?? fn()</code>.</p>
|
|
1679
|
+
<h6 id="type-parameters-8">Type Parameters</h6>
|
|
1680
|
+
<div class="table-scroll">
|
|
760
1681
|
|
|
761
1682
|
|
|
762
1683
|
|
|
@@ -767,12 +1688,8 @@ to opt into. Carries the requested kind only for debugging.</p>
|
|
|
767
1688
|
|
|
768
1689
|
|
|
769
1690
|
|
|
770
|
-
<table><thead><tr><th align="left">
|
|
771
|
-
<
|
|
772
|
-
<p><a id="query"></a></p>
|
|
773
|
-
<h3 id="query">Query</h3>
|
|
774
|
-
<p>A Firestore query (a collection ref or one with where/orderBy/limit applied).</p>
|
|
775
|
-
<h4 id="type-parameters-5">Type Parameters</h4>
|
|
1691
|
+
<table><thead><tr><th align="left">Type Parameter</th></tr></thead><tbody><tr><td align="left"><code>T</code></td></tr></tbody></table></div>
|
|
1692
|
+
<h6 id="parameters-31">Parameters</h6>
|
|
776
1693
|
<div class="table-scroll">
|
|
777
1694
|
|
|
778
1695
|
|
|
@@ -786,15 +1703,36 @@ to opt into. Carries the requested kind only for debugging.</p>
|
|
|
786
1703
|
|
|
787
1704
|
|
|
788
1705
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
<
|
|
794
|
-
<
|
|
795
|
-
<
|
|
796
|
-
<
|
|
797
|
-
<
|
|
1706
|
+
|
|
1707
|
+
|
|
1708
|
+
|
|
1709
|
+
|
|
1710
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>provenance</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#eventprovenance"><code>EventProvenance</code></a></td></tr><tr><td align="left"><code>fn</code></td><td align="left">() => <code>T</code></td></tr></tbody></table></div>
|
|
1711
|
+
<h6 id="returns-63">Returns</h6>
|
|
1712
|
+
<p><code>T</code></p>
|
|
1713
|
+
<p><a id="snapshot"></a></p>
|
|
1714
|
+
<h5 id="snapshot">snapshot()</h5>
|
|
1715
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">snapshot</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">SandboxSnapshot</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1716
|
+
<p>Capture a snapshot of every service’s state. For v1 with only
|
|
1717
|
+
Firestore, the return value carries a <code>firestore</code> key mapping doc
|
|
1718
|
+
paths to data. Future services will add their own keys.</p>
|
|
1719
|
+
<h6 id="returns-64">Returns</h6>
|
|
1720
|
+
<p><a href="/docs/pyric-sandbox-reference-api/#sandboxsnapshot"><code>SandboxSnapshot</code></a></p>
|
|
1721
|
+
<p><a id="withauth"></a></p>
|
|
1722
|
+
<h5 id="withauth">withAuth()</h5>
|
|
1723
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">withAuth</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">auth</span><span style="color:#ABB2BF">: {</span></span>
|
|
1724
|
+
<span class="line"><span style="color:#ABB2BF"> token?: </span><span style="color:#E06C75">Record</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">, unknown>;</span></span>
|
|
1725
|
+
<span class="line"><span style="color:#E06C75"> uid</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">;</span></span>
|
|
1726
|
+
<span class="line"><span style="color:#ABB2BF">}): </span><span style="color:#E06C75">SandboxContext</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1727
|
+
<p>Derive a context bound to this sandbox under the given auth
|
|
1728
|
+
identity. Operations through services attached to the returned
|
|
1729
|
+
context evaluate rules under that identity. Many contexts can
|
|
1730
|
+
coexist for one sandbox; data is shared.</p>
|
|
1731
|
+
<p><code>null</code> is anonymous; an <code>AuthState</code> object names the user (and
|
|
1732
|
+
optional custom claims). Passing <code>undefined</code> is a deliberate
|
|
1733
|
+
error — say <code>withAuth(null)</code> for anonymous so the call site is
|
|
1734
|
+
unambiguous.</p>
|
|
1735
|
+
<h6 id="parameters-32">Parameters</h6>
|
|
798
1736
|
<div class="table-scroll">
|
|
799
1737
|
|
|
800
1738
|
|
|
@@ -808,22 +1746,6 @@ to opt into. Carries the requested kind only for debugging.</p>
|
|
|
808
1746
|
|
|
809
1747
|
|
|
810
1748
|
|
|
811
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>q</code></td><td align="left"><code>ChainQuery</code></td></tr></tbody></table></div>
|
|
812
|
-
<h6 id="returns-27">Returns</h6>
|
|
813
|
-
<p><code>ChainQuery</code></p>
|
|
814
|
-
<hr>
|
|
815
|
-
<p><a id="querydocumentsnapshot"></a></p>
|
|
816
|
-
<h3 id="querydocumentsnapshot">QueryDocumentSnapshot</h3>
|
|
817
|
-
<p><code>QueryDocumentSnapshot</code> is a <code>DocumentSnapshot</code> known to exist —
|
|
818
|
-
<code>.data()</code> always returns the typed model, never <code>undefined</code>. Yielded
|
|
819
|
-
by <code>QuerySnapshot.docs</code> and passed to converter <code>fromFirestore</code>
|
|
820
|
-
callbacks. Mirrors the JS SDK’s narrowing.</p>
|
|
821
|
-
<h4 id="extends">Extends</h4>
|
|
822
|
-
<ul>
|
|
823
|
-
<li><a href="#documentsnapshot"><code>DocumentSnapshot</code></a><<code>T</code>></li>
|
|
824
|
-
</ul>
|
|
825
|
-
<h4 id="type-parameters-6">Type Parameters</h4>
|
|
826
|
-
<div class="table-scroll">
|
|
827
1749
|
|
|
828
1750
|
|
|
829
1751
|
|
|
@@ -832,13 +1754,31 @@ callbacks. Mirrors the JS SDK’s narrowing.</p>
|
|
|
832
1754
|
|
|
833
1755
|
|
|
834
1756
|
|
|
1757
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>auth</code></td><td align="left">{ <code>token?</code>: <code>Record</code><<code>string</code>, <code>unknown</code>>; <code>uid</code>: <code>string</code>; }</td></tr><tr><td align="left"><code>auth.token?</code></td><td align="left"><code>Record</code><<code>string</code>, <code>unknown</code>></td></tr><tr><td align="left"><code>auth.uid</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
1758
|
+
<h6 id="returns-65">Returns</h6>
|
|
1759
|
+
<p><a href="#sandboxcontext"><code>SandboxContext</code></a></p>
|
|
1760
|
+
<h6 id="example-1">Example</h6>
|
|
1761
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> sandbox</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> initializeSandbox</span><span style="color:#ABB2BF">();</span></span>
|
|
1762
|
+
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> dbAlice</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> getFirestore</span><span style="color:#ABB2BF">(</span><span style="color:#E5C07B">sandbox</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">withAuth</span><span style="color:#ABB2BF">({ </span><span style="color:#E06C75">uid</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">'alice'</span><span style="color:#ABB2BF"> }));</span></span>
|
|
1763
|
+
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> dbAnon</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> getFirestore</span><span style="color:#ABB2BF">(</span><span style="color:#E5C07B">sandbox</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">withAuth</span><span style="color:#ABB2BF">(</span><span style="color:#D19A66">null</span><span style="color:#ABB2BF">));</span></span></code></pre>
|
|
1764
|
+
<hr>
|
|
1765
|
+
<p><a id="sandboxcontext"></a></p>
|
|
1766
|
+
<h3 id="sandboxcontext">SandboxContext</h3>
|
|
1767
|
+
<p>Identity-bearing handle on a <a href="#sandbox">Sandbox</a>. A
|
|
1768
|
+
<code>(sandbox, auth, operationContext)</code>
|
|
1769
|
+
tuple — cheap to create, immutable, freely shareable. Service
|
|
1770
|
+
factories require a <code>SandboxContext</code>; bare <code>Sandbox</code> is a type
|
|
1771
|
+
error so every call site states identity explicitly.</p>
|
|
1772
|
+
<p>Constructed via <code>Sandbox.withAuth(auth)</code> or chained via
|
|
1773
|
+
<code>SandboxContext.withAuth(auth)</code>. The concrete class is exported
|
|
1774
|
+
from <code>pyric/sandbox</code> for <code>instanceof</code> routing in service
|
|
1775
|
+
factories; consumers don’t construct it directly.</p>
|
|
1776
|
+
<h4 id="properties-15">Properties</h4>
|
|
1777
|
+
<div class="table-scroll">
|
|
835
1778
|
|
|
836
1779
|
|
|
837
1780
|
|
|
838
1781
|
|
|
839
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#authstate"><code>AuthState</code></a></td></tr></tbody></table></div>
|
|
840
|
-
<h4 id="properties-9">Properties</h4>
|
|
841
|
-
<div class="table-scroll">
|
|
842
1782
|
|
|
843
1783
|
|
|
844
1784
|
|
|
@@ -858,21 +1798,6 @@ callbacks. Mirrors the JS SDK’s narrowing.</p>
|
|
|
858
1798
|
|
|
859
1799
|
|
|
860
1800
|
|
|
861
|
-
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><a id="exists-1"></a> <code>exists</code></td><td align="left"><code>readonly</code></td><td align="left"><code>boolean</code> | () => <code>boolean</code></td></tr><tr><td align="left"><a id="id-3"></a> <code>id</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
862
|
-
<h4 id="methods-10">Methods</h4>
|
|
863
|
-
<p><a id="data-4"></a></p>
|
|
864
|
-
<h5 id="data-2">data()</h5>
|
|
865
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">data</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
866
|
-
<h6 id="returns-28">Returns</h6>
|
|
867
|
-
<p><code>T</code></p>
|
|
868
|
-
<h6 id="overrides">Overrides</h6>
|
|
869
|
-
<p><a href="#documentsnapshot"><code>DocumentSnapshot</code></a>.<a href="#data-2"><code>data</code></a></p>
|
|
870
|
-
<hr>
|
|
871
|
-
<p><a id="querysnapshot"></a></p>
|
|
872
|
-
<h3 id="querysnapshot">QuerySnapshot</h3>
|
|
873
|
-
<p>A point-in-time view of a query result.</p>
|
|
874
|
-
<h4 id="type-parameters-7">Type Parameters</h4>
|
|
875
|
-
<div class="table-scroll">
|
|
876
1801
|
|
|
877
1802
|
|
|
878
1803
|
|
|
@@ -885,14 +1810,24 @@ callbacks. Mirrors the JS SDK’s narrowing.</p>
|
|
|
885
1810
|
|
|
886
1811
|
|
|
887
1812
|
|
|
888
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#authstate"><code>AuthState</code></a></td></tr></tbody></table></div>
|
|
889
|
-
<h4 id="properties-10">Properties</h4>
|
|
890
|
-
<div class="table-scroll">
|
|
891
1813
|
|
|
892
1814
|
|
|
893
1815
|
|
|
894
1816
|
|
|
895
1817
|
|
|
1818
|
+
<table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left"><a id="auth"></a> <code>auth</code></td><td align="left"><code>readonly</code></td><td align="left">{ <code>token?</code>: <code>Record</code><<code>string</code>, <code>unknown</code>>; <code>uid</code>: <code>string</code>; }</td><td align="left">The identity rules evaluate under for operations through this context.</td></tr><tr><td align="left"><code>auth.token?</code></td><td align="left"><code>public</code></td><td align="left"><code>Record</code><<code>string</code>, <code>unknown</code>></td><td align="left">-</td></tr><tr><td align="left"><code>auth.uid</code></td><td align="left"><code>public</code></td><td align="left"><code>string</code></td><td align="left">-</td></tr><tr><td align="left"><a id="operationcontext"></a> <code>operationContext</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="/docs/pyric-sandbox-reference-api/#operationcontext-2"><code>OperationContext</code></a></td><td align="left">Immutable provenance bound to every operation issued through this handle.</td></tr><tr><td align="left"><a id="sandbox-1"></a> <code>sandbox</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#sandbox"><code>Sandbox</code></a></td><td align="left">The data foundation this context operates against.</td></tr></tbody></table></div>
|
|
1819
|
+
<h4 id="methods-14">Methods</h4>
|
|
1820
|
+
<p><a id="withauth-2"></a></p>
|
|
1821
|
+
<h5 id="withauth-1">withAuth()</h5>
|
|
1822
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#61AFEF">withAuth</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">auth</span><span style="color:#ABB2BF">: {</span></span>
|
|
1823
|
+
<span class="line"><span style="color:#ABB2BF"> token?: </span><span style="color:#E06C75">Record</span><span style="color:#56B6C2"><</span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">, unknown>;</span></span>
|
|
1824
|
+
<span class="line"><span style="color:#E06C75"> uid</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">;</span></span>
|
|
1825
|
+
<span class="line"><span style="color:#ABB2BF">}): </span><span style="color:#E06C75">SandboxContext</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1826
|
+
<p>Derive a sibling context on the same sandbox with different auth.
|
|
1827
|
+
Replaces auth and its lens while preserving the operation source and
|
|
1828
|
+
optional plan identity.</p>
|
|
1829
|
+
<h6 id="parameters-33">Parameters</h6>
|
|
1830
|
+
<div class="table-scroll">
|
|
896
1831
|
|
|
897
1832
|
|
|
898
1833
|
|
|
@@ -912,7 +1847,10 @@ callbacks. Mirrors the JS SDK’s narrowing.</p>
|
|
|
912
1847
|
|
|
913
1848
|
|
|
914
1849
|
|
|
915
|
-
|
|
1850
|
+
|
|
1851
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>auth</code></td><td align="left">{ <code>token?</code>: <code>Record</code><<code>string</code>, <code>unknown</code>>; <code>uid</code>: <code>string</code>; }</td></tr><tr><td align="left"><code>auth.token?</code></td><td align="left"><code>Record</code><<code>string</code>, <code>unknown</code>></td></tr><tr><td align="left"><code>auth.uid</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
1852
|
+
<h6 id="returns-66">Returns</h6>
|
|
1853
|
+
<p><a href="#sandboxcontext"><code>SandboxContext</code></a></p>
|
|
916
1854
|
<hr>
|
|
917
1855
|
<p><a id="setoptions"></a></p>
|
|
918
1856
|
<h3 id="setoptions">SetOptions</h3>
|
|
@@ -930,7 +1868,7 @@ ignored; other fields in the existing doc are preserved.</li>
|
|
|
930
1868
|
<p><code>merge</code> and <code>mergeFields</code> are mutually exclusive; passing both is
|
|
931
1869
|
a programming error (<code>mergeFields</code> wins on the sandbox path,
|
|
932
1870
|
matching the JS SDK’s effective behavior).</p>
|
|
933
|
-
<h4 id="properties-
|
|
1871
|
+
<h4 id="properties-16">Properties</h4>
|
|
934
1872
|
<div class="table-scroll">
|
|
935
1873
|
|
|
936
1874
|
|
|
@@ -952,7 +1890,7 @@ matching the JS SDK’s effective behavior).</p>
|
|
|
952
1890
|
<hr>
|
|
953
1891
|
<p><a id="snapshotlistenoptions"></a></p>
|
|
954
1892
|
<h3 id="snapshotlistenoptions">SnapshotListenOptions</h3>
|
|
955
|
-
<h4 id="properties-
|
|
1893
|
+
<h4 id="properties-17">Properties</h4>
|
|
956
1894
|
<div class="table-scroll">
|
|
957
1895
|
|
|
958
1896
|
|
|
@@ -970,7 +1908,7 @@ matching the JS SDK’s effective behavior).</p>
|
|
|
970
1908
|
<hr>
|
|
971
1909
|
<p><a id="snapshotobserver"></a></p>
|
|
972
1910
|
<h3 id="snapshotobserver">SnapshotObserver</h3>
|
|
973
|
-
<h4 id="type-parameters-
|
|
1911
|
+
<h4 id="type-parameters-9">Type Parameters</h4>
|
|
974
1912
|
<div class="table-scroll">
|
|
975
1913
|
|
|
976
1914
|
|
|
@@ -983,7 +1921,7 @@ matching the JS SDK’s effective behavior).</p>
|
|
|
983
1921
|
|
|
984
1922
|
|
|
985
1923
|
<table><thead><tr><th align="left">Type Parameter</th></tr></thead><tbody><tr><td align="left"><code>T</code></td></tr></tbody></table></div>
|
|
986
|
-
<h4 id="properties-
|
|
1924
|
+
<h4 id="properties-18">Properties</h4>
|
|
987
1925
|
<div class="table-scroll">
|
|
988
1926
|
|
|
989
1927
|
|
|
@@ -1009,7 +1947,7 @@ matching the JS SDK’s effective behavior).</p>
|
|
|
1009
1947
|
<hr>
|
|
1010
1948
|
<p><a id="userauth"></a></p>
|
|
1011
1949
|
<h3 id="userauth">UserAuth</h3>
|
|
1012
|
-
<h4 id="properties-
|
|
1950
|
+
<h4 id="properties-19">Properties</h4>
|
|
1013
1951
|
<div class="table-scroll">
|
|
1014
1952
|
|
|
1015
1953
|
|
|
@@ -1072,26 +2010,78 @@ of omitting an auth field, and acting-as-a-user is named too.</p>
|
|
|
1072
2010
|
<hr>
|
|
1073
2011
|
<p><a id="authstate"></a></p>
|
|
1074
2012
|
<h3 id="authstate">AuthState</h3>
|
|
1075
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">type</span><span style="color:#E5C07B"> AuthState</span><span style="color:#56B6C2"> =</span
|
|
2013
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">type</span><span style="color:#E5C07B"> AuthState</span><span style="color:#56B6C2"> =</span></span>
|
|
2014
|
+
<span class="line"><span style="color:#ABB2BF"> | {</span></span>
|
|
2015
|
+
<span class="line"><span style="color:#E06C75"> token</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Record</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">>;</span></span>
|
|
2016
|
+
<span class="line"><span style="color:#E06C75"> uid</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">;</span></span>
|
|
2017
|
+
<span class="line"><span style="color:#ABB2BF">}</span></span>
|
|
2018
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">null</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2019
|
+
<p>A signed-in identity for sandbox operations. <code>null</code> is anonymous.</p>
|
|
2020
|
+
<p><code>token</code> is the Firebase Auth token claims map (custom claims plus
|
|
2021
|
+
standard ones). It surfaces the same way it does in production rules
|
|
2022
|
+
via <code>request.auth.token.*</code>. Omit it for plain UID-only auth.</p>
|
|
2023
|
+
<p>Renamed from <code>AuthContext</code> (pre-multi-context) so the data type
|
|
2024
|
+
doesn’t visually collide with <code>SandboxContext</code> (the identity-bearing
|
|
2025
|
+
handle). They sit at different layers — payload vs. handle — and the
|
|
2026
|
+
names should reflect that.</p>
|
|
2027
|
+
<hr>
|
|
2028
|
+
<p><a id="documentdata"></a></p>
|
|
2029
|
+
<h3 id="documentdata">DocumentData</h3>
|
|
2030
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">type</span><span style="color:#E5C07B"> DocumentData</span><span style="color:#56B6C2"> =</span><span style="color:#E5C07B"> Record</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">>;</span></span></code></pre>
|
|
2031
|
+
<hr>
|
|
2032
|
+
<p><a id="fieldvaluesentinel"></a></p>
|
|
2033
|
+
<h3 id="fieldvaluesentinel">FieldValueSentinel</h3>
|
|
2034
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">type</span><span style="color:#E5C07B"> FieldValueSentinel</span><span style="color:#56B6C2"> =</span></span>
|
|
2035
|
+
<span class="line"><span style="color:#ABB2BF"> | {</span></span>
|
|
2036
|
+
<span class="line"><span style="color:#ABB2BF">}</span></span>
|
|
2037
|
+
<span class="line"><span style="color:#ABB2BF"> | {</span></span>
|
|
2038
|
+
<span class="line"><span style="color:#E06C75"> value</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">number</span><span style="color:#ABB2BF">;</span></span>
|
|
2039
|
+
<span class="line"><span style="color:#ABB2BF">}</span></span>
|
|
2040
|
+
<span class="line"><span style="color:#ABB2BF"> | {</span></span>
|
|
2041
|
+
<span class="line"><span style="color:#E06C75"> values</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">[];</span></span>
|
|
2042
|
+
<span class="line"><span style="color:#ABB2BF">}</span></span>
|
|
2043
|
+
<span class="line"><span style="color:#ABB2BF"> | {</span></span>
|
|
2044
|
+
<span class="line"><span style="color:#E06C75"> values</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">[];</span></span>
|
|
2045
|
+
<span class="line"><span style="color:#ABB2BF">}</span></span>
|
|
2046
|
+
<span class="line"><span style="color:#ABB2BF"> | {</span></span>
|
|
2047
|
+
<span class="line"><span style="color:#ABB2BF">};</span></span></code></pre>
|
|
1076
2048
|
<hr>
|
|
1077
2049
|
<p><a id="loglevel"></a></p>
|
|
1078
2050
|
<h3 id="loglevel">LogLevel</h3>
|
|
1079
2051
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">type</span><span style="color:#E5C07B"> LogLevel</span><span style="color:#56B6C2"> =</span><span style="color:#98C379"> "debug"</span><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"verbose"</span><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"info"</span><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"warn"</span><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"error"</span><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"silent"</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1080
2052
|
<p>Mirrors <code>firebase/firestore</code>’s <code>LogLevel</code> union.</p>
|
|
1081
2053
|
<hr>
|
|
2054
|
+
<p><a id="orderdirection"></a></p>
|
|
2055
|
+
<h3 id="orderdirection">OrderDirection</h3>
|
|
2056
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">type</span><span style="color:#E5C07B"> OrderDirection</span><span style="color:#56B6C2"> =</span><span style="color:#98C379"> "asc"</span><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"desc"</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2057
|
+
<hr>
|
|
1082
2058
|
<p><a id="transaction"></a></p>
|
|
1083
2059
|
<h3 id="transaction">Transaction</h3>
|
|
1084
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">type</span><span style="color:#E5C07B"> Transaction</span><span style="color:#56B6C2"> =</span><span style="color:#E5C07B">
|
|
2060
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">type</span><span style="color:#E5C07B"> Transaction</span><span style="color:#56B6C2"> =</span><span style="color:#E5C07B"> Transaction</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1085
2061
|
<hr>
|
|
1086
2062
|
<p><a id="unsubscribe"></a></p>
|
|
1087
2063
|
<h3 id="unsubscribe">Unsubscribe()</h3>
|
|
1088
2064
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">type</span><span style="color:#E5C07B"> Unsubscribe</span><span style="color:#56B6C2"> =</span><span style="color:#ABB2BF"> () </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1089
|
-
<h4 id="returns-
|
|
2065
|
+
<h4 id="returns-67">Returns</h4>
|
|
1090
2066
|
<p><code>void</code></p>
|
|
1091
2067
|
<hr>
|
|
2068
|
+
<p><a id="wherefilterop"></a></p>
|
|
2069
|
+
<h3 id="wherefilterop">WhereFilterOp</h3>
|
|
2070
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">type</span><span style="color:#E5C07B"> WhereFilterOp</span><span style="color:#56B6C2"> =</span></span>
|
|
2071
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"<"</span></span>
|
|
2072
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"<="</span></span>
|
|
2073
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"=="</span></span>
|
|
2074
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"!="</span></span>
|
|
2075
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">">="</span></span>
|
|
2076
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">">"</span></span>
|
|
2077
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"in"</span></span>
|
|
2078
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"not-in"</span></span>
|
|
2079
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"array-contains"</span></span>
|
|
2080
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"array-contains-any"</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2081
|
+
<hr>
|
|
1092
2082
|
<p><a id="writebatch"></a></p>
|
|
1093
2083
|
<h3 id="writebatch">WriteBatch</h3>
|
|
1094
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">type</span><span style="color:#E5C07B"> WriteBatch</span><span style="color:#56B6C2"> =</span><span style="color:#E5C07B">
|
|
2084
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">type</span><span style="color:#E5C07B"> WriteBatch</span><span style="color:#56B6C2"> =</span><span style="color:#E5C07B"> WriteBatch</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1095
2085
|
<h2 id="variables">Variables</h2>
|
|
1096
2086
|
<p><a id="target_symbol-1"></a></p>
|
|
1097
2087
|
<h3 id="target_symbol">TARGET_SYMBOL</h3>
|
|
@@ -1101,14 +2091,17 @@ the sandbox backend so free functions can recover their owner.</p>
|
|
|
1101
2091
|
<h2 id="functions">Functions</h2>
|
|
1102
2092
|
<p><a id="actingas"></a></p>
|
|
1103
2093
|
<h3 id="actingas">actingAs()</h3>
|
|
1104
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> actingAs</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">sandbox</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Sandbox</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">identity</span><span style="color:#ABB2BF">: </span
|
|
2094
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> actingAs</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">sandbox</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Sandbox</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">identity</span><span style="color:#ABB2BF">: {</span></span>
|
|
2095
|
+
<span class="line"><span style="color:#E06C75"> token</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Record</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">>;</span></span>
|
|
2096
|
+
<span class="line"><span style="color:#E06C75"> uid</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">;</span></span>
|
|
2097
|
+
<span class="line"><span style="color:#ABB2BF">}): </span><span style="color:#E5C07B">Firestore</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1105
2098
|
<p>A Firestore handle scoped to a specific identity, for multi-user testing.</p>
|
|
1106
2099
|
<p><code>actingAs(sandbox, { uid })</code> returns a <code>Firestore</code> whose ops evaluate security
|
|
1107
2100
|
rules as that user (<code>request.auth.uid === uid</code>; custom claims via <code>token</code>);
|
|
1108
2101
|
<code>actingAs(sandbox, null)</code> is the anonymous (signed-out) path. Multiple
|
|
1109
2102
|
identities over ONE sandbox share the same store, so a write by one is
|
|
1110
2103
|
delivered to another’s <code>onSnapshot</code>: the basis for multi-user sync testing.</p>
|
|
1111
|
-
<h4 id="parameters-
|
|
2104
|
+
<h4 id="parameters-34">Parameters</h4>
|
|
1112
2105
|
<div class="table-scroll">
|
|
1113
2106
|
|
|
1114
2107
|
|
|
@@ -1126,10 +2119,18 @@ delivered to another’s <code>onSnapshot</code>: the basis for multi-user sync
|
|
|
1126
2119
|
|
|
1127
2120
|
|
|
1128
2121
|
|
|
1129
|
-
|
|
1130
|
-
|
|
2122
|
+
|
|
2123
|
+
|
|
2124
|
+
|
|
2125
|
+
|
|
2126
|
+
|
|
2127
|
+
|
|
2128
|
+
|
|
2129
|
+
|
|
2130
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>sandbox</code></td><td align="left"><a href="#sandbox"><code>Sandbox</code></a></td></tr><tr><td align="left"><code>identity</code></td><td align="left">{ <code>token?</code>: <code>Record</code><<code>string</code>, <code>unknown</code>>; <code>uid</code>: <code>string</code>; }</td></tr><tr><td align="left"><code>identity.token?</code></td><td align="left"><code>Record</code><<code>string</code>, <code>unknown</code>></td></tr><tr><td align="left"><code>identity.uid</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
2131
|
+
<h4 id="returns-68">Returns</h4>
|
|
1131
2132
|
<p><a href="#firestore"><code>Firestore</code></a></p>
|
|
1132
|
-
<h4 id="example">Example</h4>
|
|
2133
|
+
<h4 id="example-2">Example</h4>
|
|
1133
2134
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">initializeSandbox</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/sandbox'</span><span style="color:#ABB2BF">;</span></span>
|
|
1134
2135
|
<span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">actingAs</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">doc</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">setDoc</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">onSnapshot</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/firestore'</span><span style="color:#ABB2BF">;</span></span>
|
|
1135
2136
|
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> sandbox</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> initializeSandbox</span><span style="color:#ABB2BF">();</span></span>
|
|
@@ -1146,7 +2147,7 @@ the design rationale.</p>
|
|
|
1146
2147
|
<p><a id="adddoc"></a></p>
|
|
1147
2148
|
<h3 id="adddoc">addDoc()</h3>
|
|
1148
2149
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> addDoc</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75;font-style:italic">coll</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">CollectionReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>, </span><span style="color:#E06C75;font-style:italic">data</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">DocumentReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>>;</span></span></code></pre>
|
|
1149
|
-
<h4 id="type-parameters-
|
|
2150
|
+
<h4 id="type-parameters-10">Type Parameters</h4>
|
|
1150
2151
|
<div class="table-scroll">
|
|
1151
2152
|
|
|
1152
2153
|
|
|
@@ -1160,8 +2161,8 @@ the design rationale.</p>
|
|
|
1160
2161
|
|
|
1161
2162
|
|
|
1162
2163
|
|
|
1163
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><code>DocumentData</code></td></tr></tbody></table></div>
|
|
1164
|
-
<h4 id="parameters-
|
|
2164
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
2165
|
+
<h4 id="parameters-35">Parameters</h4>
|
|
1165
2166
|
<div class="table-scroll">
|
|
1166
2167
|
|
|
1167
2168
|
|
|
@@ -1180,7 +2181,7 @@ the design rationale.</p>
|
|
|
1180
2181
|
|
|
1181
2182
|
|
|
1182
2183
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>coll</code></td><td align="left"><a href="#collectionreference"><code>CollectionReference</code></a><<code>T</code>></td></tr><tr><td align="left"><code>data</code></td><td align="left"><code>T</code></td></tr></tbody></table></div>
|
|
1183
|
-
<h4 id="returns-
|
|
2184
|
+
<h4 id="returns-69">Returns</h4>
|
|
1184
2185
|
<p><code>Promise</code><<a href="#documentreference"><code>DocumentReference</code></a><<code>T</code>>></p>
|
|
1185
2186
|
<hr>
|
|
1186
2187
|
<p><a id="and"></a></p>
|
|
@@ -1189,7 +2190,7 @@ the design rationale.</p>
|
|
|
1189
2190
|
<p>AND composite. Same shape as <code>or()</code> but every inner constraint
|
|
1190
2191
|
must match. Useful inside an <code>or()</code> to combine constraints that
|
|
1191
2192
|
would otherwise be at the top level.</p>
|
|
1192
|
-
<h4 id="parameters-
|
|
2193
|
+
<h4 id="parameters-36">Parameters</h4>
|
|
1193
2194
|
<div class="table-scroll">
|
|
1194
2195
|
|
|
1195
2196
|
|
|
@@ -1204,13 +2205,13 @@ would otherwise be at the top level.</p>
|
|
|
1204
2205
|
|
|
1205
2206
|
|
|
1206
2207
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left">…<code>filters</code></td><td align="left"><a href="#queryconstraint"><code>QueryConstraint</code></a>[]</td></tr></tbody></table></div>
|
|
1207
|
-
<h4 id="returns-
|
|
2208
|
+
<h4 id="returns-70">Returns</h4>
|
|
1208
2209
|
<p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
|
|
1209
2210
|
<hr>
|
|
1210
|
-
<p><a id="arrayremove"></a></p>
|
|
1211
|
-
<h3 id="arrayremove">arrayRemove()</h3>
|
|
2211
|
+
<p><a id="arrayremove-2"></a></p>
|
|
2212
|
+
<h3 id="arrayremove-1">arrayRemove()</h3>
|
|
1212
2213
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> arrayRemove</span><span style="color:#ABB2BF">(...</span><span style="color:#E06C75;font-style:italic">values</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">[]): </span><span style="color:#E5C07B">FieldValueSentinel</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1213
|
-
<h4 id="parameters-
|
|
2214
|
+
<h4 id="parameters-37">Parameters</h4>
|
|
1214
2215
|
<div class="table-scroll">
|
|
1215
2216
|
|
|
1216
2217
|
|
|
@@ -1225,13 +2226,13 @@ would otherwise be at the top level.</p>
|
|
|
1225
2226
|
|
|
1226
2227
|
|
|
1227
2228
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left">…<code>values</code></td><td align="left"><code>unknown</code>[]</td></tr></tbody></table></div>
|
|
1228
|
-
<h4 id="returns-
|
|
1229
|
-
<p><code>FieldValueSentinel</code></p>
|
|
2229
|
+
<h4 id="returns-71">Returns</h4>
|
|
2230
|
+
<p><a href="#fieldvaluesentinel"><code>FieldValueSentinel</code></a></p>
|
|
1230
2231
|
<hr>
|
|
1231
|
-
<p><a id="arrayunion"></a></p>
|
|
1232
|
-
<h3 id="arrayunion">arrayUnion()</h3>
|
|
2232
|
+
<p><a id="arrayunion-2"></a></p>
|
|
2233
|
+
<h3 id="arrayunion-1">arrayUnion()</h3>
|
|
1233
2234
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> arrayUnion</span><span style="color:#ABB2BF">(...</span><span style="color:#E06C75;font-style:italic">values</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">[]): </span><span style="color:#E5C07B">FieldValueSentinel</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1234
|
-
<h4 id="parameters-
|
|
2235
|
+
<h4 id="parameters-38">Parameters</h4>
|
|
1235
2236
|
<div class="table-scroll">
|
|
1236
2237
|
|
|
1237
2238
|
|
|
@@ -1246,14 +2247,14 @@ would otherwise be at the top level.</p>
|
|
|
1246
2247
|
|
|
1247
2248
|
|
|
1248
2249
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left">…<code>values</code></td><td align="left"><code>unknown</code>[]</td></tr></tbody></table></div>
|
|
1249
|
-
<h4 id="returns-
|
|
1250
|
-
<p><code>FieldValueSentinel</code></p>
|
|
2250
|
+
<h4 id="returns-72">Returns</h4>
|
|
2251
|
+
<p><a href="#fieldvaluesentinel"><code>FieldValueSentinel</code></a></p>
|
|
1251
2252
|
<hr>
|
|
1252
2253
|
<p><a id="average"></a></p>
|
|
1253
2254
|
<h3 id="average">average()</h3>
|
|
1254
2255
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> average</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">field</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">AggregateField</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1255
2256
|
<p>Factory: average-of-<code>field</code> aggregate.</p>
|
|
1256
|
-
<h4 id="parameters-
|
|
2257
|
+
<h4 id="parameters-39">Parameters</h4>
|
|
1257
2258
|
<div class="table-scroll">
|
|
1258
2259
|
|
|
1259
2260
|
|
|
@@ -1268,7 +2269,7 @@ would otherwise be at the top level.</p>
|
|
|
1268
2269
|
|
|
1269
2270
|
|
|
1270
2271
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>field</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
1271
|
-
<h4 id="returns-
|
|
2272
|
+
<h4 id="returns-73">Returns</h4>
|
|
1272
2273
|
<p><a href="#aggregatefield"><code>AggregateField</code></a></p>
|
|
1273
2274
|
<hr>
|
|
1274
2275
|
<p><a id="clearindexeddbpersistence"></a></p>
|
|
@@ -1287,7 +2288,7 @@ same way as a <code>sandbox</code>/<code>sandbox-live</code> target’s <code>.s
|
|
|
1287
2288
|
both variants do, in fact, so this always has a sandbox to call into.</p>
|
|
1288
2289
|
<p>The real SDK requires this before Firestore starts; the sandbox’s mapped
|
|
1289
2290
|
<code>clearPersistence()</code> has no such restriction.</p>
|
|
1290
|
-
<h4 id="parameters-
|
|
2291
|
+
<h4 id="parameters-40">Parameters</h4>
|
|
1291
2292
|
<div class="table-scroll">
|
|
1292
2293
|
|
|
1293
2294
|
|
|
@@ -1302,7 +2303,7 @@ both variants do, in fact, so this always has a sandbox to call into.</p>
|
|
|
1302
2303
|
|
|
1303
2304
|
|
|
1304
2305
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>db</code></td><td align="left"><a href="#firestore"><code>Firestore</code></a></td></tr></tbody></table></div>
|
|
1305
|
-
<h4 id="returns-
|
|
2306
|
+
<h4 id="returns-74">Returns</h4>
|
|
1306
2307
|
<p><code>Promise</code><<code>void</code>></p>
|
|
1307
2308
|
<hr>
|
|
1308
2309
|
<p><a id="collection"></a></p>
|
|
@@ -1310,7 +2311,7 @@ both variants do, in fact, so this always has a sandbox to call into.</p>
|
|
|
1310
2311
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> collection</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">parent</span><span style="color:#ABB2BF">:</span></span>
|
|
1311
2312
|
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">Firestore</span></span>
|
|
1312
2313
|
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">DocumentReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">DocumentData</span><span style="color:#ABB2BF">>, ...</span><span style="color:#E06C75;font-style:italic">pathSegments</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">[]): </span><span style="color:#E5C07B">CollectionReference</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1313
|
-
<h4 id="parameters-
|
|
2314
|
+
<h4 id="parameters-41">Parameters</h4>
|
|
1314
2315
|
<div class="table-scroll">
|
|
1315
2316
|
|
|
1316
2317
|
|
|
@@ -1328,8 +2329,8 @@ both variants do, in fact, so this always has a sandbox to call into.</p>
|
|
|
1328
2329
|
|
|
1329
2330
|
|
|
1330
2331
|
|
|
1331
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>parent</code></td><td align="left">| <a href="#firestore"><code>Firestore</code></a> | <a href="#documentreference"><code>DocumentReference</code></a><<code>DocumentData</code>></td></tr><tr><td align="left">…<code>pathSegments</code></td><td align="left"><code>string</code>[]</td></tr></tbody></table></div>
|
|
1332
|
-
<h4 id="returns-
|
|
2332
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>parent</code></td><td align="left">| <a href="#firestore"><code>Firestore</code></a> | <a href="#documentreference"><code>DocumentReference</code></a><<a href="#documentdata"><code>DocumentData</code></a>></td></tr><tr><td align="left">…<code>pathSegments</code></td><td align="left"><code>string</code>[]</td></tr></tbody></table></div>
|
|
2333
|
+
<h4 id="returns-75">Returns</h4>
|
|
1333
2334
|
<p><a href="#collectionreference"><code>CollectionReference</code></a></p>
|
|
1334
2335
|
<hr>
|
|
1335
2336
|
<p><a id="collectiongroup"></a></p>
|
|
@@ -1340,7 +2341,7 @@ collection whose final segment matches <code>collectionId</code>. Mirrors
|
|
|
1340
2341
|
<code>firebase/firestore</code>’s <code>collectionGroup(db, id)</code> shape.</p>
|
|
1341
2342
|
<p>Returned <code>Query</code> accepts the same <code>where</code> / <code>orderBy</code> / <code>limit</code>
|
|
1342
2343
|
constraints as any other query.</p>
|
|
1343
|
-
<h4 id="parameters-
|
|
2344
|
+
<h4 id="parameters-42">Parameters</h4>
|
|
1344
2345
|
<div class="table-scroll">
|
|
1345
2346
|
|
|
1346
2347
|
|
|
@@ -1359,7 +2360,7 @@ constraints as any other query.</p>
|
|
|
1359
2360
|
|
|
1360
2361
|
|
|
1361
2362
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>db</code></td><td align="left"><a href="#firestore"><code>Firestore</code></a></td></tr><tr><td align="left"><code>collectionId</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
1362
|
-
<h4 id="returns-
|
|
2363
|
+
<h4 id="returns-76">Returns</h4>
|
|
1363
2364
|
<p><a href="#query"><code>Query</code></a></p>
|
|
1364
2365
|
<hr>
|
|
1365
2366
|
<p><a id="connectfirestoreemulator"></a></p>
|
|
@@ -1383,7 +2384,7 @@ constraints as any other query.</p>
|
|
|
1383
2384
|
<p>No-op in the sandbox mirror because the sandbox already runs locally.</p>
|
|
1384
2385
|
<p>The option shape remains source-compatible with Firebase so canonical
|
|
1385
2386
|
initialization code can call it unconditionally.</p>
|
|
1386
|
-
<h4 id="parameters-
|
|
2387
|
+
<h4 id="parameters-43">Parameters</h4>
|
|
1387
2388
|
<div class="table-scroll">
|
|
1388
2389
|
|
|
1389
2390
|
|
|
@@ -1414,14 +2415,14 @@ initialization code can call it unconditionally.</p>
|
|
|
1414
2415
|
|
|
1415
2416
|
|
|
1416
2417
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>db</code></td><td align="left"><a href="#firestore"><code>Firestore</code></a></td></tr><tr><td align="left"><code>host</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><code>port</code></td><td align="left"><code>number</code></td></tr><tr><td align="left"><code>options?</code></td><td align="left">{ <code>mockUserToken?</code>: | <code>string</code> | { [<code>claim</code>: <code>string</code>]: <code>unknown</code>; <code>firebase?</code>: { <code>identities?</code>: <code>Record</code><<code>string</code>, <code>string</code>[]>; <code>sign_in_provider?</code>: <code>string</code>; }; <code>sub?</code>: <code>string</code>; <code>user_id?</code>: <code>string</code>; }; }</td></tr><tr><td align="left"><code>options.mockUserToken?</code></td><td align="left">| <code>string</code> | { [<code>claim</code>: <code>string</code>]: <code>unknown</code>; <code>firebase?</code>: { <code>identities?</code>: <code>Record</code><<code>string</code>, <code>string</code>[]>; <code>sign_in_provider?</code>: <code>string</code>; }; <code>sub?</code>: <code>string</code>; <code>user_id?</code>: <code>string</code>; }</td></tr></tbody></table></div>
|
|
1417
|
-
<h4 id="returns-
|
|
2418
|
+
<h4 id="returns-77">Returns</h4>
|
|
1418
2419
|
<p><code>void</code></p>
|
|
1419
2420
|
<hr>
|
|
1420
2421
|
<p><a id="count"></a></p>
|
|
1421
2422
|
<h3 id="count">count()</h3>
|
|
1422
2423
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> count</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">AggregateField</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1423
2424
|
<p>Factory: count() aggregate.</p>
|
|
1424
|
-
<h4 id="returns-
|
|
2425
|
+
<h4 id="returns-78">Returns</h4>
|
|
1425
2426
|
<p><a href="#aggregatefield"><code>AggregateField</code></a></p>
|
|
1426
2427
|
<hr>
|
|
1427
2428
|
<p><a id="createfirestoredatatools"></a></p>
|
|
@@ -1430,7 +2431,7 @@ initialization code can call it unconditionally.</p>
|
|
|
1430
2431
|
<p>Modular Web-SDK-shaped Firestore data tools — get, list, create,
|
|
1431
2432
|
update, delete. Each tool’s <code>auth</code> arg is forwarded to the
|
|
1432
2433
|
resolver; omitted = admin mode, supplied = user mode.</p>
|
|
1433
|
-
<h4 id="parameters-
|
|
2434
|
+
<h4 id="parameters-44">Parameters</h4>
|
|
1434
2435
|
<div class="table-scroll">
|
|
1435
2436
|
|
|
1436
2437
|
|
|
@@ -1445,7 +2446,7 @@ resolver; omitted = admin mode, supplied = user mode.</p>
|
|
|
1445
2446
|
|
|
1446
2447
|
|
|
1447
2448
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>deps</code></td><td align="left"><a href="#firestoredatatooldeps"><code>FirestoreDataToolDeps</code></a></td></tr></tbody></table></div>
|
|
1448
|
-
<h4 id="returns-
|
|
2449
|
+
<h4 id="returns-79">Returns</h4>
|
|
1449
2450
|
<p><code>ToolHandler</code><<code>unknown</code>, <code>unknown</code>>[]</p>
|
|
1450
2451
|
<hr>
|
|
1451
2452
|
<p><a id="createfirestoreinspecttools"></a></p>
|
|
@@ -1464,7 +2465,7 @@ document census by collection, and the most-recent denials + requests
|
|
|
1464
2465
|
from sandbox.history(). Everything an agent needs to localize a
|
|
1465
2466
|
sandbox bug in one round-trip.</p>
|
|
1466
2467
|
<p>Sandbox-only. <code>resolveSandbox</code> must return the owning Sandbox.</p>
|
|
1467
|
-
<h4 id="parameters-
|
|
2468
|
+
<h4 id="parameters-45">Parameters</h4>
|
|
1468
2469
|
<div class="table-scroll">
|
|
1469
2470
|
|
|
1470
2471
|
|
|
@@ -1479,13 +2480,13 @@ sandbox bug in one round-trip.</p>
|
|
|
1479
2480
|
|
|
1480
2481
|
|
|
1481
2482
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>deps</code></td><td align="left"><a href="#firestoreinspecttooldeps"><code>FirestoreInspectToolDeps</code></a></td></tr></tbody></table></div>
|
|
1482
|
-
<h4 id="returns-
|
|
2483
|
+
<h4 id="returns-80">Returns</h4>
|
|
1483
2484
|
<p><code>ToolHandler</code><<code>unknown</code>, <code>unknown</code>>[]</p>
|
|
1484
2485
|
<hr>
|
|
1485
2486
|
<p><a id="deletedoc"></a></p>
|
|
1486
2487
|
<h3 id="deletedoc">deleteDoc()</h3>
|
|
1487
2488
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> deleteDoc</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">ref</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DocumentReference</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">>;</span></span></code></pre>
|
|
1488
|
-
<h4 id="parameters-
|
|
2489
|
+
<h4 id="parameters-46">Parameters</h4>
|
|
1489
2490
|
<div class="table-scroll">
|
|
1490
2491
|
|
|
1491
2492
|
|
|
@@ -1500,14 +2501,14 @@ sandbox bug in one round-trip.</p>
|
|
|
1500
2501
|
|
|
1501
2502
|
|
|
1502
2503
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><a href="#documentreference"><code>DocumentReference</code></a></td></tr></tbody></table></div>
|
|
1503
|
-
<h4 id="returns-
|
|
2504
|
+
<h4 id="returns-81">Returns</h4>
|
|
1504
2505
|
<p><code>Promise</code><<code>void</code>></p>
|
|
1505
2506
|
<hr>
|
|
1506
2507
|
<p><a id="deletefield"></a></p>
|
|
1507
2508
|
<h3 id="deletefield">deleteField()</h3>
|
|
1508
2509
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> deleteField</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">FieldValueSentinel</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1509
|
-
<h4 id="returns-
|
|
1510
|
-
<p><code>FieldValueSentinel</code></p>
|
|
2510
|
+
<h4 id="returns-82">Returns</h4>
|
|
2511
|
+
<p><a href="#fieldvaluesentinel"><code>FieldValueSentinel</code></a></p>
|
|
1511
2512
|
<hr>
|
|
1512
2513
|
<p><a id="disablenetwork"></a></p>
|
|
1513
2514
|
<h3 id="disablenetwork">disableNetwork()</h3>
|
|
@@ -1520,7 +2521,7 @@ queuing, because the sandbox cannot honestly deliver “queued until
|
|
|
1520
2521
|
reconnected” when there is no connection to lose in the first place.
|
|
1521
2522
|
App code that calls this to prep for flaky connectivity will not
|
|
1522
2523
|
crash, but it also will not observe write-queuing behavior.</p>
|
|
1523
|
-
<h4 id="parameters-
|
|
2524
|
+
<h4 id="parameters-47">Parameters</h4>
|
|
1524
2525
|
<div class="table-scroll">
|
|
1525
2526
|
|
|
1526
2527
|
|
|
@@ -1535,7 +2536,7 @@ crash, but it also will not observe write-queuing behavior.</p>
|
|
|
1535
2536
|
|
|
1536
2537
|
|
|
1537
2538
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>db</code></td><td align="left"><a href="#firestore"><code>Firestore</code></a></td></tr></tbody></table></div>
|
|
1538
|
-
<h4 id="returns-
|
|
2539
|
+
<h4 id="returns-83">Returns</h4>
|
|
1539
2540
|
<p><code>Promise</code><<code>void</code>></p>
|
|
1540
2541
|
<hr>
|
|
1541
2542
|
<p><a id="doc"></a></p>
|
|
@@ -1543,7 +2544,7 @@ crash, but it also will not observe write-queuing behavior.</p>
|
|
|
1543
2544
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> doc</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75;font-style:italic">parent</span><span style="color:#ABB2BF">:</span></span>
|
|
1544
2545
|
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">Firestore</span></span>
|
|
1545
2546
|
<span class="line"><span style="color:#ABB2BF">| </span><span style="color:#E5C07B">CollectionReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>, ...</span><span style="color:#E06C75;font-style:italic">pathSegments</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">[]): </span><span style="color:#E5C07B">DocumentReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>;</span></span></code></pre>
|
|
1546
|
-
<h4 id="type-parameters-
|
|
2547
|
+
<h4 id="type-parameters-11">Type Parameters</h4>
|
|
1547
2548
|
<div class="table-scroll">
|
|
1548
2549
|
|
|
1549
2550
|
|
|
@@ -1557,8 +2558,8 @@ crash, but it also will not observe write-queuing behavior.</p>
|
|
|
1557
2558
|
|
|
1558
2559
|
|
|
1559
2560
|
|
|
1560
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><code>DocumentData</code></td></tr></tbody></table></div>
|
|
1561
|
-
<h4 id="parameters-
|
|
2561
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
2562
|
+
<h4 id="parameters-48">Parameters</h4>
|
|
1562
2563
|
<div class="table-scroll">
|
|
1563
2564
|
|
|
1564
2565
|
|
|
@@ -1577,13 +2578,13 @@ crash, but it also will not observe write-queuing behavior.</p>
|
|
|
1577
2578
|
|
|
1578
2579
|
|
|
1579
2580
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>parent</code></td><td align="left">| <a href="#firestore"><code>Firestore</code></a> | <a href="#collectionreference"><code>CollectionReference</code></a><<code>T</code>></td></tr><tr><td align="left">…<code>pathSegments</code></td><td align="left"><code>string</code>[]</td></tr></tbody></table></div>
|
|
1580
|
-
<h4 id="returns-
|
|
2581
|
+
<h4 id="returns-84">Returns</h4>
|
|
1581
2582
|
<p><a href="#documentreference"><code>DocumentReference</code></a><<code>T</code>></p>
|
|
1582
2583
|
<hr>
|
|
1583
2584
|
<p><a id="documentid"></a></p>
|
|
1584
2585
|
<h3 id="documentid">documentId()</h3>
|
|
1585
2586
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> documentId</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">FieldPath</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1586
|
-
<h4 id="returns-
|
|
2587
|
+
<h4 id="returns-85">Returns</h4>
|
|
1587
2588
|
<p><a href="#fieldpath"><code>FieldPath</code></a></p>
|
|
1588
2589
|
<hr>
|
|
1589
2590
|
<p><a id="enableindexeddbpersistence"></a></p>
|
|
@@ -1599,7 +2600,7 @@ exists in the real SDK to protect an actual cache-initialization
|
|
|
1599
2600
|
race; the sandbox has no such race (there’s no cache to initialize),
|
|
1600
2601
|
so enforcing the same restriction would only make app code that
|
|
1601
2602
|
calls this defensively at startup fail for no local reason.</p>
|
|
1602
|
-
<h4 id="parameters-
|
|
2603
|
+
<h4 id="parameters-49">Parameters</h4>
|
|
1603
2604
|
<div class="table-scroll">
|
|
1604
2605
|
|
|
1605
2606
|
|
|
@@ -1618,7 +2619,7 @@ calls this defensively at startup fail for no local reason.</p>
|
|
|
1618
2619
|
|
|
1619
2620
|
|
|
1620
2621
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>db</code></td><td align="left"><a href="#firestore"><code>Firestore</code></a></td></tr><tr><td align="left"><code>persistenceSettings?</code></td><td align="left"><a href="#persistencesettings"><code>PersistenceSettings</code></a></td></tr></tbody></table></div>
|
|
1621
|
-
<h4 id="returns-
|
|
2622
|
+
<h4 id="returns-86">Returns</h4>
|
|
1622
2623
|
<p><code>Promise</code><<code>void</code>></p>
|
|
1623
2624
|
<hr>
|
|
1624
2625
|
<p><a id="enablemultitabindexeddbpersistence"></a></p>
|
|
@@ -1628,7 +2629,7 @@ calls this defensively at startup fail for no local reason.</p>
|
|
|
1628
2629
|
Multi-tab coordination is meaningless here too: the sandbox’s
|
|
1629
2630
|
SharedWorker path already IS the single shared store every tab talks
|
|
1630
2631
|
to, so there’s no separate “multi-tab” mode to opt into.</p>
|
|
1631
|
-
<h4 id="parameters-
|
|
2632
|
+
<h4 id="parameters-50">Parameters</h4>
|
|
1632
2633
|
<div class="table-scroll">
|
|
1633
2634
|
|
|
1634
2635
|
|
|
@@ -1643,7 +2644,7 @@ to, so there’s no separate “multi-tab” mode to opt into.</p>
|
|
|
1643
2644
|
|
|
1644
2645
|
|
|
1645
2646
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>db</code></td><td align="left"><a href="#firestore"><code>Firestore</code></a></td></tr></tbody></table></div>
|
|
1646
|
-
<h4 id="returns-
|
|
2647
|
+
<h4 id="returns-87">Returns</h4>
|
|
1647
2648
|
<p><code>Promise</code><<code>void</code>></p>
|
|
1648
2649
|
<hr>
|
|
1649
2650
|
<p><a id="enablenetwork"></a></p>
|
|
@@ -1651,7 +2652,7 @@ to, so there’s no separate “multi-tab” mode to opt into.</p>
|
|
|
1651
2652
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> enableNetwork</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">db</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Firestore</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">>;</span></span></code></pre>
|
|
1652
2653
|
<p>Sandbox: no-op success, symmetric with <a href="#disablenetwork">disableNetwork</a> — since
|
|
1653
2654
|
network was never disabled locally, there is nothing to re-enable.</p>
|
|
1654
|
-
<h4 id="parameters-
|
|
2655
|
+
<h4 id="parameters-51">Parameters</h4>
|
|
1655
2656
|
<div class="table-scroll">
|
|
1656
2657
|
|
|
1657
2658
|
|
|
@@ -1666,7 +2667,7 @@ network was never disabled locally, there is nothing to re-enable.</p>
|
|
|
1666
2667
|
|
|
1667
2668
|
|
|
1668
2669
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>db</code></td><td align="left"><a href="#firestore"><code>Firestore</code></a></td></tr></tbody></table></div>
|
|
1669
|
-
<h4 id="returns-
|
|
2670
|
+
<h4 id="returns-88">Returns</h4>
|
|
1670
2671
|
<p><code>Promise</code><<code>void</code>></p>
|
|
1671
2672
|
<hr>
|
|
1672
2673
|
<p><a id="endat"></a></p>
|
|
@@ -1675,7 +2676,7 @@ network was never disabled locally, there is nothing to re-enable.</p>
|
|
|
1675
2676
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> endAt</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">snapshot</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DocumentSnapshot</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1676
2677
|
<p>End the query at the document whose ordered field values match
|
|
1677
2678
|
the cursor. Inclusive — the document at the cursor IS included.</p>
|
|
1678
|
-
<h5 id="parameters-
|
|
2679
|
+
<h5 id="parameters-52">Parameters</h5>
|
|
1679
2680
|
<div class="table-scroll">
|
|
1680
2681
|
|
|
1681
2682
|
|
|
@@ -1690,13 +2691,13 @@ the cursor. Inclusive — the document at the cursor IS included.</p>
|
|
|
1690
2691
|
|
|
1691
2692
|
|
|
1692
2693
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>snapshot</code></td><td align="left"><a href="#documentsnapshot"><code>DocumentSnapshot</code></a></td></tr></tbody></table></div>
|
|
1693
|
-
<h5 id="returns-
|
|
2694
|
+
<h5 id="returns-89">Returns</h5>
|
|
1694
2695
|
<p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
|
|
1695
2696
|
<h4 id="call-signature-1">Call Signature</h4>
|
|
1696
2697
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> endAt</span><span style="color:#ABB2BF">(...</span><span style="color:#E06C75;font-style:italic">values</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">[]): </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1697
2698
|
<p>End the query at the document whose ordered field values match
|
|
1698
2699
|
the cursor. Inclusive — the document at the cursor IS included.</p>
|
|
1699
|
-
<h5 id="parameters-
|
|
2700
|
+
<h5 id="parameters-53">Parameters</h5>
|
|
1700
2701
|
<div class="table-scroll">
|
|
1701
2702
|
|
|
1702
2703
|
|
|
@@ -1711,7 +2712,7 @@ the cursor. Inclusive — the document at the cursor IS included.</p>
|
|
|
1711
2712
|
|
|
1712
2713
|
|
|
1713
2714
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left">…<code>values</code></td><td align="left"><code>unknown</code>[]</td></tr></tbody></table></div>
|
|
1714
|
-
<h5 id="returns-
|
|
2715
|
+
<h5 id="returns-90">Returns</h5>
|
|
1715
2716
|
<p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
|
|
1716
2717
|
<hr>
|
|
1717
2718
|
<p><a id="endbefore"></a></p>
|
|
@@ -1720,7 +2721,7 @@ the cursor. Inclusive — the document at the cursor IS included.</p>
|
|
|
1720
2721
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> endBefore</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">snapshot</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DocumentSnapshot</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1721
2722
|
<p>Same as <code>endAt</code>, but EXCLUDES the document at the cursor — the
|
|
1722
2723
|
result ends at the prior ordered position.</p>
|
|
1723
|
-
<h5 id="parameters-
|
|
2724
|
+
<h5 id="parameters-54">Parameters</h5>
|
|
1724
2725
|
<div class="table-scroll">
|
|
1725
2726
|
|
|
1726
2727
|
|
|
@@ -1735,13 +2736,13 @@ result ends at the prior ordered position.</p>
|
|
|
1735
2736
|
|
|
1736
2737
|
|
|
1737
2738
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>snapshot</code></td><td align="left"><a href="#documentsnapshot"><code>DocumentSnapshot</code></a></td></tr></tbody></table></div>
|
|
1738
|
-
<h5 id="returns-
|
|
2739
|
+
<h5 id="returns-91">Returns</h5>
|
|
1739
2740
|
<p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
|
|
1740
2741
|
<h4 id="call-signature-3">Call Signature</h4>
|
|
1741
2742
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> endBefore</span><span style="color:#ABB2BF">(...</span><span style="color:#E06C75;font-style:italic">values</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">[]): </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
1742
2743
|
<p>Same as <code>endAt</code>, but EXCLUDES the document at the cursor — the
|
|
1743
2744
|
result ends at the prior ordered position.</p>
|
|
1744
|
-
<h5 id="parameters-
|
|
2745
|
+
<h5 id="parameters-55">Parameters</h5>
|
|
1745
2746
|
<div class="table-scroll">
|
|
1746
2747
|
|
|
1747
2748
|
|
|
@@ -1756,7 +2757,7 @@ result ends at the prior ordered position.</p>
|
|
|
1756
2757
|
|
|
1757
2758
|
|
|
1758
2759
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left">…<code>values</code></td><td align="left"><code>unknown</code>[]</td></tr></tbody></table></div>
|
|
1759
|
-
<h5 id="returns-
|
|
2760
|
+
<h5 id="returns-92">Returns</h5>
|
|
1760
2761
|
<p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
|
|
1761
2762
|
<hr>
|
|
1762
2763
|
<p><a id="getadminfirestore"></a></p>
|
|
@@ -1781,7 +2782,7 @@ handle is a FROZEN <code>sandbox</code> target: it does not track
|
|
|
1781
2782
|
<p>Intended for Studio’s “edit anything as admin” surfaces (F2) and the
|
|
1782
2783
|
serve worker’s <code>{ mode: 'admin' }</code> auth lens. For rules-applied
|
|
1783
2784
|
impersonation (“act as this user”), use <code>getFirestore(sandbox.withAuth({ uid }))</code> instead.</p>
|
|
1784
|
-
<h5 id="parameters-
|
|
2785
|
+
<h5 id="parameters-56">Parameters</h5>
|
|
1785
2786
|
<div class="table-scroll">
|
|
1786
2787
|
|
|
1787
2788
|
|
|
@@ -1795,10 +2796,10 @@ impersonation (“act as this user”), use <code>getFirestore(sandbox.withAuth(
|
|
|
1795
2796
|
|
|
1796
2797
|
|
|
1797
2798
|
|
|
1798
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>sandbox</code></td><td align="left"><code>Sandbox</code></td></tr></tbody></table></div>
|
|
1799
|
-
<h5 id="returns-
|
|
2799
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>sandbox</code></td><td align="left"><a href="#sandbox"><code>Sandbox</code></a></td></tr></tbody></table></div>
|
|
2800
|
+
<h5 id="returns-93">Returns</h5>
|
|
1800
2801
|
<p><a href="#firestore"><code>Firestore</code></a></p>
|
|
1801
|
-
<h5 id="example-
|
|
2802
|
+
<h5 id="example-3">Example</h5>
|
|
1802
2803
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">initializeSandbox</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/sandbox'</span><span style="color:#ABB2BF">;</span></span>
|
|
1803
2804
|
<span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">getAdminFirestore</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">doc</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">setDoc</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/firestore'</span><span style="color:#ABB2BF">;</span></span>
|
|
1804
2805
|
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> sandbox</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> initializeSandbox</span><span style="color:#ABB2BF">();</span></span>
|
|
@@ -1824,7 +2825,7 @@ handle is a FROZEN <code>sandbox</code> target: it does not track
|
|
|
1824
2825
|
<p>Intended for Studio’s “edit anything as admin” surfaces (F2) and the
|
|
1825
2826
|
serve worker’s <code>{ mode: 'admin' }</code> auth lens. For rules-applied
|
|
1826
2827
|
impersonation (“act as this user”), use <code>getFirestore(sandbox.withAuth({ uid }))</code> instead.</p>
|
|
1827
|
-
<h5 id="parameters-
|
|
2828
|
+
<h5 id="parameters-57">Parameters</h5>
|
|
1828
2829
|
<div class="table-scroll">
|
|
1829
2830
|
|
|
1830
2831
|
|
|
@@ -1838,10 +2839,10 @@ impersonation (“act as this user”), use <code>getFirestore(sandbox.withAuth(
|
|
|
1838
2839
|
|
|
1839
2840
|
|
|
1840
2841
|
|
|
1841
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ctx</code></td><td align="left"><code>SandboxContext</code></td></tr></tbody></table></div>
|
|
1842
|
-
<h5 id="returns-
|
|
2842
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ctx</code></td><td align="left"><a href="#sandboxcontext"><code>SandboxContext</code></a></td></tr></tbody></table></div>
|
|
2843
|
+
<h5 id="returns-94">Returns</h5>
|
|
1843
2844
|
<p><a href="#firestore"><code>Firestore</code></a></p>
|
|
1844
|
-
<h5 id="example-
|
|
2845
|
+
<h5 id="example-4">Example</h5>
|
|
1845
2846
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">initializeSandbox</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/sandbox'</span><span style="color:#ABB2BF">;</span></span>
|
|
1846
2847
|
<span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">getAdminFirestore</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">doc</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">setDoc</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/firestore'</span><span style="color:#ABB2BF">;</span></span>
|
|
1847
2848
|
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> sandbox</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> initializeSandbox</span><span style="color:#ABB2BF">();</span></span>
|
|
@@ -1867,7 +2868,7 @@ handle is a FROZEN <code>sandbox</code> target: it does not track
|
|
|
1867
2868
|
<p>Intended for Studio’s “edit anything as admin” surfaces (F2) and the
|
|
1868
2869
|
serve worker’s <code>{ mode: 'admin' }</code> auth lens. For rules-applied
|
|
1869
2870
|
impersonation (“act as this user”), use <code>getFirestore(sandbox.withAuth({ uid }))</code> instead.</p>
|
|
1870
|
-
<h5 id="parameters-
|
|
2871
|
+
<h5 id="parameters-58">Parameters</h5>
|
|
1871
2872
|
<div class="table-scroll">
|
|
1872
2873
|
|
|
1873
2874
|
|
|
@@ -1881,10 +2882,10 @@ impersonation (“act as this user”), use <code>getFirestore(sandbox.withAuth(
|
|
|
1881
2882
|
|
|
1882
2883
|
|
|
1883
2884
|
|
|
1884
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>app</code></td><td align="left"><code>FirebaseApp</code></td></tr></tbody></table></div>
|
|
1885
|
-
<h5 id="returns-
|
|
2885
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>app</code></td><td align="left"><a href="/docs/pyric-app-reference-api/#firebaseapp"><code>FirebaseApp</code></a></td></tr></tbody></table></div>
|
|
2886
|
+
<h5 id="returns-95">Returns</h5>
|
|
1886
2887
|
<p><a href="#firestore"><code>Firestore</code></a></p>
|
|
1887
|
-
<h5 id="example-
|
|
2888
|
+
<h5 id="example-5">Example</h5>
|
|
1888
2889
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">initializeSandbox</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/sandbox'</span><span style="color:#ABB2BF">;</span></span>
|
|
1889
2890
|
<span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">getAdminFirestore</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">doc</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">setDoc</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/firestore'</span><span style="color:#ABB2BF">;</span></span>
|
|
1890
2891
|
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> sandbox</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> initializeSandbox</span><span style="color:#ABB2BF">();</span></span>
|
|
@@ -1900,7 +2901,7 @@ impersonation (“act as this user”), use <code>getFirestore(sandbox.withAuth(
|
|
|
1900
2901
|
keyed by caller-chosen aliases; the returned snapshot’s <code>.data()</code>
|
|
1901
2902
|
uses the same keys.</p>
|
|
1902
2903
|
<p>The sandbox target dispatches straight into the chainable adapter.</p>
|
|
1903
|
-
<h4 id="type-parameters-
|
|
2904
|
+
<h4 id="type-parameters-12">Type Parameters</h4>
|
|
1904
2905
|
<div class="table-scroll">
|
|
1905
2906
|
|
|
1906
2907
|
|
|
@@ -1913,7 +2914,7 @@ uses the same keys.</p>
|
|
|
1913
2914
|
|
|
1914
2915
|
|
|
1915
2916
|
<table><thead><tr><th align="left">Type Parameter</th></tr></thead><tbody><tr><td align="left"><code>S</code> <em>extends</em> <a href="#aggregatespec"><code>AggregateSpec</code></a></td></tr></tbody></table></div>
|
|
1916
|
-
<h4 id="parameters-
|
|
2917
|
+
<h4 id="parameters-59">Parameters</h4>
|
|
1917
2918
|
<div class="table-scroll">
|
|
1918
2919
|
|
|
1919
2920
|
|
|
@@ -1931,8 +2932,8 @@ uses the same keys.</p>
|
|
|
1931
2932
|
|
|
1932
2933
|
|
|
1933
2934
|
|
|
1934
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>source</code></td><td align="left">| <a href="#query"><code>Query</code></a><<code>DocumentData</code>> | <a href="#collectionreference"><code>CollectionReference</code></a><<code>DocumentData</code>></td></tr><tr><td align="left"><code>spec</code></td><td align="left"><code>S</code></td></tr></tbody></table></div>
|
|
1935
|
-
<h4 id="returns-
|
|
2935
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>source</code></td><td align="left">| <a href="#query"><code>Query</code></a><<a href="#documentdata"><code>DocumentData</code></a>> | <a href="#collectionreference"><code>CollectionReference</code></a><<a href="#documentdata"><code>DocumentData</code></a>></td></tr><tr><td align="left"><code>spec</code></td><td align="left"><code>S</code></td></tr></tbody></table></div>
|
|
2936
|
+
<h4 id="returns-96">Returns</h4>
|
|
1936
2937
|
<p><code>Promise</code><<a href="#aggregatequerysnapshot"><code>AggregateQuerySnapshot</code></a><{ [K in string | number | symbol]: number }>></p>
|
|
1937
2938
|
<hr>
|
|
1938
2939
|
<p><a id="getcountfromserver"></a></p>
|
|
@@ -1945,7 +2946,7 @@ uses the same keys.</p>
|
|
|
1945
2946
|
<p>Count documents matching the query. Returns a snapshot whose
|
|
1946
2947
|
<code>.data()</code> yields <code>{ count: N }</code> — same shape <code>firebase/firestore</code>’s
|
|
1947
2948
|
<code>getCountFromServer</code> produces.</p>
|
|
1948
|
-
<h4 id="parameters-
|
|
2949
|
+
<h4 id="parameters-60">Parameters</h4>
|
|
1949
2950
|
<div class="table-scroll">
|
|
1950
2951
|
|
|
1951
2952
|
|
|
@@ -1959,8 +2960,8 @@ uses the same keys.</p>
|
|
|
1959
2960
|
|
|
1960
2961
|
|
|
1961
2962
|
|
|
1962
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>source</code></td><td align="left">| <a href="#query"><code>Query</code></a><<code>DocumentData</code>> | <a href="#collectionreference"><code>CollectionReference</code></a><<code>DocumentData</code>></td></tr></tbody></table></div>
|
|
1963
|
-
<h4 id="returns-
|
|
2963
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>source</code></td><td align="left">| <a href="#query"><code>Query</code></a><<a href="#documentdata"><code>DocumentData</code></a>> | <a href="#collectionreference"><code>CollectionReference</code></a><<a href="#documentdata"><code>DocumentData</code></a>></td></tr></tbody></table></div>
|
|
2964
|
+
<h4 id="returns-97">Returns</h4>
|
|
1964
2965
|
<p><code>Promise</code><<a href="#aggregatequerysnapshot"><code>AggregateQuerySnapshot</code></a><{
|
|
1965
2966
|
<code>count</code>: <code>number</code>;
|
|
1966
2967
|
}>></p>
|
|
@@ -1968,7 +2969,7 @@ uses the same keys.</p>
|
|
|
1968
2969
|
<p><a id="getdoc"></a></p>
|
|
1969
2970
|
<h3 id="getdoc">getDoc()</h3>
|
|
1970
2971
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> getDoc</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75;font-style:italic">ref</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DocumentReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">DocumentSnapshot</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>>;</span></span></code></pre>
|
|
1971
|
-
<h4 id="type-parameters-
|
|
2972
|
+
<h4 id="type-parameters-13">Type Parameters</h4>
|
|
1972
2973
|
<div class="table-scroll">
|
|
1973
2974
|
|
|
1974
2975
|
|
|
@@ -1982,8 +2983,8 @@ uses the same keys.</p>
|
|
|
1982
2983
|
|
|
1983
2984
|
|
|
1984
2985
|
|
|
1985
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><code>DocumentData</code></td></tr></tbody></table></div>
|
|
1986
|
-
<h4 id="parameters-
|
|
2986
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
2987
|
+
<h4 id="parameters-61">Parameters</h4>
|
|
1987
2988
|
<div class="table-scroll">
|
|
1988
2989
|
|
|
1989
2990
|
|
|
@@ -1998,7 +2999,7 @@ uses the same keys.</p>
|
|
|
1998
2999
|
|
|
1999
3000
|
|
|
2000
3001
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><a href="#documentreference"><code>DocumentReference</code></a><<code>T</code>></td></tr></tbody></table></div>
|
|
2001
|
-
<h4 id="returns-
|
|
3002
|
+
<h4 id="returns-98">Returns</h4>
|
|
2002
3003
|
<p><code>Promise</code><<a href="#documentsnapshot"><code>DocumentSnapshot</code></a><<code>T</code>>></p>
|
|
2003
3004
|
<hr>
|
|
2004
3005
|
<p><a id="getdocfromcache"></a></p>
|
|
@@ -2009,7 +3010,7 @@ uses the same keys.</p>
|
|
|
2009
3010
|
ref); pyric never misses — the local store always has whatever is
|
|
2010
3011
|
there — so this never throws for that reason. Documented divergence,
|
|
2011
3012
|
not a claim of parity.</p>
|
|
2012
|
-
<h4 id="type-parameters-
|
|
3013
|
+
<h4 id="type-parameters-14">Type Parameters</h4>
|
|
2013
3014
|
<div class="table-scroll">
|
|
2014
3015
|
|
|
2015
3016
|
|
|
@@ -2023,8 +3024,8 @@ not a claim of parity.</p>
|
|
|
2023
3024
|
|
|
2024
3025
|
|
|
2025
3026
|
|
|
2026
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><code>DocumentData</code></td></tr></tbody></table></div>
|
|
2027
|
-
<h4 id="parameters-
|
|
3027
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
3028
|
+
<h4 id="parameters-62">Parameters</h4>
|
|
2028
3029
|
<div class="table-scroll">
|
|
2029
3030
|
|
|
2030
3031
|
|
|
@@ -2039,7 +3040,7 @@ not a claim of parity.</p>
|
|
|
2039
3040
|
|
|
2040
3041
|
|
|
2041
3042
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><a href="#documentreference"><code>DocumentReference</code></a><<code>T</code>></td></tr></tbody></table></div>
|
|
2042
|
-
<h4 id="returns-
|
|
3043
|
+
<h4 id="returns-99">Returns</h4>
|
|
2043
3044
|
<p><code>Promise</code><<a href="#documentsnapshot"><code>DocumentSnapshot</code></a><<code>T</code>>></p>
|
|
2044
3045
|
<hr>
|
|
2045
3046
|
<p><a id="getdocfromserver"></a></p>
|
|
@@ -2049,7 +3050,7 @@ not a claim of parity.</p>
|
|
|
2049
3050
|
authoritative, always-fresh source — there is no separate server
|
|
2050
3051
|
round-trip to force, so “from server” and the default read are the
|
|
2051
3052
|
same honest thing.</p>
|
|
2052
|
-
<h4 id="type-parameters-
|
|
3053
|
+
<h4 id="type-parameters-15">Type Parameters</h4>
|
|
2053
3054
|
<div class="table-scroll">
|
|
2054
3055
|
|
|
2055
3056
|
|
|
@@ -2063,8 +3064,8 @@ same honest thing.</p>
|
|
|
2063
3064
|
|
|
2064
3065
|
|
|
2065
3066
|
|
|
2066
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><code>DocumentData</code></td></tr></tbody></table></div>
|
|
2067
|
-
<h4 id="parameters-
|
|
3067
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
3068
|
+
<h4 id="parameters-63">Parameters</h4>
|
|
2068
3069
|
<div class="table-scroll">
|
|
2069
3070
|
|
|
2070
3071
|
|
|
@@ -2079,13 +3080,13 @@ same honest thing.</p>
|
|
|
2079
3080
|
|
|
2080
3081
|
|
|
2081
3082
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><a href="#documentreference"><code>DocumentReference</code></a><<code>T</code>></td></tr></tbody></table></div>
|
|
2082
|
-
<h4 id="returns-
|
|
3083
|
+
<h4 id="returns-100">Returns</h4>
|
|
2083
3084
|
<p><code>Promise</code><<a href="#documentsnapshot"><code>DocumentSnapshot</code></a><<code>T</code>>></p>
|
|
2084
3085
|
<hr>
|
|
2085
3086
|
<p><a id="getdocs"></a></p>
|
|
2086
3087
|
<h3 id="getdocs">getDocs()</h3>
|
|
2087
3088
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> getDocs</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75;font-style:italic">query</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">QuerySnapshot</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>>;</span></span></code></pre>
|
|
2088
|
-
<h4 id="type-parameters-
|
|
3089
|
+
<h4 id="type-parameters-16">Type Parameters</h4>
|
|
2089
3090
|
<div class="table-scroll">
|
|
2090
3091
|
|
|
2091
3092
|
|
|
@@ -2099,8 +3100,8 @@ same honest thing.</p>
|
|
|
2099
3100
|
|
|
2100
3101
|
|
|
2101
3102
|
|
|
2102
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><code>DocumentData</code></td></tr></tbody></table></div>
|
|
2103
|
-
<h4 id="parameters-
|
|
3103
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
3104
|
+
<h4 id="parameters-64">Parameters</h4>
|
|
2104
3105
|
<div class="table-scroll">
|
|
2105
3106
|
|
|
2106
3107
|
|
|
@@ -2115,14 +3116,14 @@ same honest thing.</p>
|
|
|
2115
3116
|
|
|
2116
3117
|
|
|
2117
3118
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>query</code></td><td align="left"><a href="#query"><code>Query</code></a><<code>T</code>></td></tr></tbody></table></div>
|
|
2118
|
-
<h4 id="returns-
|
|
3119
|
+
<h4 id="returns-101">Returns</h4>
|
|
2119
3120
|
<p><code>Promise</code><<a href="#querysnapshot"><code>QuerySnapshot</code></a><<code>T</code>>></p>
|
|
2120
3121
|
<hr>
|
|
2121
3122
|
<p><a id="getdocsfromcache"></a></p>
|
|
2122
3123
|
<h3 id="getdocsfromcache">getDocsFromCache()</h3>
|
|
2123
3124
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> getDocsFromCache</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75;font-style:italic">query</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">QuerySnapshot</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>>;</span></span></code></pre>
|
|
2124
3125
|
<p>Query-plural form of <a href="#getdocfromcache">getDocFromCache</a> — same cache-miss divergence.</p>
|
|
2125
|
-
<h4 id="type-parameters-
|
|
3126
|
+
<h4 id="type-parameters-17">Type Parameters</h4>
|
|
2126
3127
|
<div class="table-scroll">
|
|
2127
3128
|
|
|
2128
3129
|
|
|
@@ -2136,8 +3137,8 @@ same honest thing.</p>
|
|
|
2136
3137
|
|
|
2137
3138
|
|
|
2138
3139
|
|
|
2139
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><code>DocumentData</code></td></tr></tbody></table></div>
|
|
2140
|
-
<h4 id="parameters-
|
|
3140
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
3141
|
+
<h4 id="parameters-65">Parameters</h4>
|
|
2141
3142
|
<div class="table-scroll">
|
|
2142
3143
|
|
|
2143
3144
|
|
|
@@ -2152,14 +3153,14 @@ same honest thing.</p>
|
|
|
2152
3153
|
|
|
2153
3154
|
|
|
2154
3155
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>query</code></td><td align="left"><a href="#query"><code>Query</code></a><<code>T</code>></td></tr></tbody></table></div>
|
|
2155
|
-
<h4 id="returns-
|
|
3156
|
+
<h4 id="returns-102">Returns</h4>
|
|
2156
3157
|
<p><code>Promise</code><<a href="#querysnapshot"><code>QuerySnapshot</code></a><<code>T</code>>></p>
|
|
2157
3158
|
<hr>
|
|
2158
3159
|
<p><a id="getdocsfromserver"></a></p>
|
|
2159
3160
|
<h3 id="getdocsfromserver">getDocsFromServer()</h3>
|
|
2160
3161
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> getDocsFromServer</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75;font-style:italic">query</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">QuerySnapshot</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>>;</span></span></code></pre>
|
|
2161
3162
|
<p>Query-plural form of <a href="#getdocfromserver">getDocFromServer</a>.</p>
|
|
2162
|
-
<h4 id="type-parameters-
|
|
3163
|
+
<h4 id="type-parameters-18">Type Parameters</h4>
|
|
2163
3164
|
<div class="table-scroll">
|
|
2164
3165
|
|
|
2165
3166
|
|
|
@@ -2173,8 +3174,8 @@ same honest thing.</p>
|
|
|
2173
3174
|
|
|
2174
3175
|
|
|
2175
3176
|
|
|
2176
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><code>DocumentData</code></td></tr></tbody></table></div>
|
|
2177
|
-
<h4 id="parameters-
|
|
3177
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
3178
|
+
<h4 id="parameters-66">Parameters</h4>
|
|
2178
3179
|
<div class="table-scroll">
|
|
2179
3180
|
|
|
2180
3181
|
|
|
@@ -2189,7 +3190,7 @@ same honest thing.</p>
|
|
|
2189
3190
|
|
|
2190
3191
|
|
|
2191
3192
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>query</code></td><td align="left"><a href="#query"><code>Query</code></a><<code>T</code>></td></tr></tbody></table></div>
|
|
2192
|
-
<h4 id="returns-
|
|
3193
|
+
<h4 id="returns-103">Returns</h4>
|
|
2193
3194
|
<p><code>Promise</code><<a href="#querysnapshot"><code>QuerySnapshot</code></a><<code>T</code>>></p>
|
|
2194
3195
|
<hr>
|
|
2195
3196
|
<p><a id="getfirestore"></a></p>
|
|
@@ -2208,7 +3209,7 @@ scenario.</li>
|
|
|
2208
3209
|
identity through <code>pyric/auth</code> — every Firestore op evaluates
|
|
2209
3210
|
rules under whatever user is currently signed in.</li>
|
|
2210
3211
|
</ul>
|
|
2211
|
-
<h5 id="parameters-
|
|
3212
|
+
<h5 id="parameters-67">Parameters</h5>
|
|
2212
3213
|
<div class="table-scroll">
|
|
2213
3214
|
|
|
2214
3215
|
|
|
@@ -2222,10 +3223,10 @@ rules under whatever user is currently signed in.</li>
|
|
|
2222
3223
|
|
|
2223
3224
|
|
|
2224
3225
|
|
|
2225
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ctx</code></td><td align="left"><code>SandboxContext</code></td></tr></tbody></table></div>
|
|
2226
|
-
<h5 id="returns-
|
|
3226
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ctx</code></td><td align="left"><a href="#sandboxcontext"><code>SandboxContext</code></a></td></tr></tbody></table></div>
|
|
3227
|
+
<h5 id="returns-104">Returns</h5>
|
|
2227
3228
|
<p><a href="#firestore"><code>Firestore</code></a></p>
|
|
2228
|
-
<h5 id="example-
|
|
3229
|
+
<h5 id="example-6">Example</h5>
|
|
2229
3230
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#7F848E;font-style:italic">// Sandbox, frozen identity (runner / explicit tests).</span></span>
|
|
2230
3231
|
<span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">initializeSandbox</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/sandbox'</span><span style="color:#ABB2BF">;</span></span>
|
|
2231
3232
|
<span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">getFirestore</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">doc</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">setDoc</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/firestore'</span><span style="color:#ABB2BF">;</span></span>
|
|
@@ -2259,7 +3260,7 @@ scenario.</li>
|
|
|
2259
3260
|
identity through <code>pyric/auth</code> — every Firestore op evaluates
|
|
2260
3261
|
rules under whatever user is currently signed in.</li>
|
|
2261
3262
|
</ul>
|
|
2262
|
-
<h5 id="parameters-
|
|
3263
|
+
<h5 id="parameters-68">Parameters</h5>
|
|
2263
3264
|
<div class="table-scroll">
|
|
2264
3265
|
|
|
2265
3266
|
|
|
@@ -2273,10 +3274,10 @@ rules under whatever user is currently signed in.</li>
|
|
|
2273
3274
|
|
|
2274
3275
|
|
|
2275
3276
|
|
|
2276
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>sandbox</code></td><td align="left"><code>Sandbox</code></td></tr></tbody></table></div>
|
|
2277
|
-
<h5 id="returns-
|
|
3277
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>sandbox</code></td><td align="left"><a href="#sandbox"><code>Sandbox</code></a></td></tr></tbody></table></div>
|
|
3278
|
+
<h5 id="returns-105">Returns</h5>
|
|
2278
3279
|
<p><a href="#firestore"><code>Firestore</code></a></p>
|
|
2279
|
-
<h5 id="example-
|
|
3280
|
+
<h5 id="example-7">Example</h5>
|
|
2280
3281
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#7F848E;font-style:italic">// Sandbox, frozen identity (runner / explicit tests).</span></span>
|
|
2281
3282
|
<span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">initializeSandbox</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/sandbox'</span><span style="color:#ABB2BF">;</span></span>
|
|
2282
3283
|
<span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">getFirestore</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">doc</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">setDoc</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/firestore'</span><span style="color:#ABB2BF">;</span></span>
|
|
@@ -2310,7 +3311,7 @@ scenario.</li>
|
|
|
2310
3311
|
identity through <code>pyric/auth</code> — every Firestore op evaluates
|
|
2311
3312
|
rules under whatever user is currently signed in.</li>
|
|
2312
3313
|
</ul>
|
|
2313
|
-
<h5 id="parameters-
|
|
3314
|
+
<h5 id="parameters-69">Parameters</h5>
|
|
2314
3315
|
<div class="table-scroll">
|
|
2315
3316
|
|
|
2316
3317
|
|
|
@@ -2324,10 +3325,10 @@ rules under whatever user is currently signed in.</li>
|
|
|
2324
3325
|
|
|
2325
3326
|
|
|
2326
3327
|
|
|
2327
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>app</code></td><td align="left"><code>FirebaseApp</code></td></tr></tbody></table></div>
|
|
2328
|
-
<h5 id="returns-
|
|
3328
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>app</code></td><td align="left"><a href="/docs/pyric-app-reference-api/#firebaseapp"><code>FirebaseApp</code></a></td></tr></tbody></table></div>
|
|
3329
|
+
<h5 id="returns-106">Returns</h5>
|
|
2329
3330
|
<p><a href="#appfirestore"><code>AppFirestore</code></a></p>
|
|
2330
|
-
<h5 id="example-
|
|
3331
|
+
<h5 id="example-8">Example</h5>
|
|
2331
3332
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#7F848E;font-style:italic">// Sandbox, frozen identity (runner / explicit tests).</span></span>
|
|
2332
3333
|
<span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">initializeSandbox</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/sandbox'</span><span style="color:#ABB2BF">;</span></span>
|
|
2333
3334
|
<span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">getFirestore</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">doc</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">setDoc</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/firestore'</span><span style="color:#ABB2BF">;</span></span>
|
|
@@ -2361,9 +3362,9 @@ scenario.</li>
|
|
|
2361
3362
|
identity through <code>pyric/auth</code> — every Firestore op evaluates
|
|
2362
3363
|
rules under whatever user is currently signed in.</li>
|
|
2363
3364
|
</ul>
|
|
2364
|
-
<h5 id="returns-
|
|
3365
|
+
<h5 id="returns-107">Returns</h5>
|
|
2365
3366
|
<p><a href="#appfirestore"><code>AppFirestore</code></a></p>
|
|
2366
|
-
<h5 id="example-
|
|
3367
|
+
<h5 id="example-9">Example</h5>
|
|
2367
3368
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#7F848E;font-style:italic">// Sandbox, frozen identity (runner / explicit tests).</span></span>
|
|
2368
3369
|
<span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">initializeSandbox</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/sandbox'</span><span style="color:#ABB2BF">;</span></span>
|
|
2369
3370
|
<span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">getFirestore</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">doc</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">setDoc</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/firestore'</span><span style="color:#ABB2BF">;</span></span>
|
|
@@ -2384,7 +3385,10 @@ rules under whatever user is currently signed in.</li>
|
|
|
2384
3385
|
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> app</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> initializeApp</span><span style="color:#ABB2BF">({ </span><span style="color:#E06C75">projectId</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">'demo-project'</span><span style="color:#ABB2BF"> });</span></span>
|
|
2385
3386
|
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> db</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> getFirestore</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">app</span><span style="color:#ABB2BF">);</span></span></code></pre>
|
|
2386
3387
|
<h4 id="call-signature-11">Call Signature</h4>
|
|
2387
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> getFirestore</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">target</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF"
|
|
3388
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> getFirestore</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">target</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">:</span></span>
|
|
3389
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">FirebaseApp</span></span>
|
|
3390
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">Sandbox</span></span>
|
|
3391
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">SandboxContext</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Firestore</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2388
3392
|
<p>Construct a Firestore handle. Three overloads dispatch by the
|
|
2389
3393
|
input’s shape:</p>
|
|
2390
3394
|
<ul>
|
|
@@ -2397,7 +3401,7 @@ scenario.</li>
|
|
|
2397
3401
|
identity through <code>pyric/auth</code> — every Firestore op evaluates
|
|
2398
3402
|
rules under whatever user is currently signed in.</li>
|
|
2399
3403
|
</ul>
|
|
2400
|
-
<h5 id="parameters-
|
|
3404
|
+
<h5 id="parameters-70">Parameters</h5>
|
|
2401
3405
|
<div class="table-scroll">
|
|
2402
3406
|
|
|
2403
3407
|
|
|
@@ -2411,10 +3415,10 @@ rules under whatever user is currently signed in.</li>
|
|
|
2411
3415
|
|
|
2412
3416
|
|
|
2413
3417
|
|
|
2414
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>target?</code></td><td align="left"><code>
|
|
2415
|
-
<h5 id="returns-
|
|
3418
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>target?</code></td><td align="left">| <a href="/docs/pyric-app-reference-api/#firebaseapp"><code>FirebaseApp</code></a> | <a href="#sandbox"><code>Sandbox</code></a> | <a href="#sandboxcontext"><code>SandboxContext</code></a></td></tr></tbody></table></div>
|
|
3419
|
+
<h5 id="returns-108">Returns</h5>
|
|
2416
3420
|
<p><a href="#firestore"><code>Firestore</code></a></p>
|
|
2417
|
-
<h5 id="example-
|
|
3421
|
+
<h5 id="example-10">Example</h5>
|
|
2418
3422
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#7F848E;font-style:italic">// Sandbox, frozen identity (runner / explicit tests).</span></span>
|
|
2419
3423
|
<span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">initializeSandbox</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/sandbox'</span><span style="color:#ABB2BF">;</span></span>
|
|
2420
3424
|
<span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">getFirestore</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">doc</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">setDoc</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/firestore'</span><span style="color:#ABB2BF">;</span></span>
|
|
@@ -2435,10 +3439,10 @@ rules under whatever user is currently signed in.</li>
|
|
|
2435
3439
|
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> app</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> initializeApp</span><span style="color:#ABB2BF">({ </span><span style="color:#E06C75">projectId</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">'demo-project'</span><span style="color:#ABB2BF"> });</span></span>
|
|
2436
3440
|
<span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> db</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> getFirestore</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">app</span><span style="color:#ABB2BF">);</span></span></code></pre>
|
|
2437
3441
|
<hr>
|
|
2438
|
-
<p><a id="increment"></a></p>
|
|
2439
|
-
<h3 id="increment">increment()</h3>
|
|
3442
|
+
<p><a id="increment-2"></a></p>
|
|
3443
|
+
<h3 id="increment-1">increment()</h3>
|
|
2440
3444
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> increment</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">n</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">number</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">FieldValueSentinel</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2441
|
-
<h4 id="parameters-
|
|
3445
|
+
<h4 id="parameters-71">Parameters</h4>
|
|
2442
3446
|
<div class="table-scroll">
|
|
2443
3447
|
|
|
2444
3448
|
|
|
@@ -2453,13 +3457,16 @@ rules under whatever user is currently signed in.</li>
|
|
|
2453
3457
|
|
|
2454
3458
|
|
|
2455
3459
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>n</code></td><td align="left"><code>number</code></td></tr></tbody></table></div>
|
|
2456
|
-
<h4 id="returns-
|
|
2457
|
-
<p><code>FieldValueSentinel</code></p>
|
|
3460
|
+
<h4 id="returns-109">Returns</h4>
|
|
3461
|
+
<p><a href="#fieldvaluesentinel"><code>FieldValueSentinel</code></a></p>
|
|
2458
3462
|
<hr>
|
|
2459
3463
|
<p><a id="initializefirestore"></a></p>
|
|
2460
3464
|
<h3 id="initializefirestore">initializeFirestore()</h3>
|
|
2461
3465
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> initializeFirestore</span><span style="color:#ABB2BF">(</span></span>
|
|
2462
|
-
<span class="line"><span style="color:#E06C75;font-style:italic"> app</span><span style="color:#ABB2BF"
|
|
3466
|
+
<span class="line"><span style="color:#E06C75;font-style:italic"> app</span><span style="color:#ABB2BF">:</span></span>
|
|
3467
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">FirebaseApp</span></span>
|
|
3468
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">Sandbox</span></span>
|
|
3469
|
+
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">SandboxContext</span><span style="color:#ABB2BF">,</span></span>
|
|
2463
3470
|
<span class="line"><span style="color:#E06C75;font-style:italic"> _settings</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">FirestoreSettings</span><span style="color:#ABB2BF">,</span></span>
|
|
2464
3471
|
<span class="line"><span style="color:#E06C75;font-style:italic"> _databaseId</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Firestore</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2465
3472
|
<p>Delegates to <a href="#getfirestore">getFirestore</a> and returns the same handle. Accepts
|
|
@@ -2468,7 +3475,7 @@ writes — <code>initializeFirestore(app, { localCache: persistentLocalCache(...
|
|
|
2468
3475
|
— no longer crashes at import) but no-ops the cache/network settings:
|
|
2469
3476
|
persistence is already the sandbox default, so there is nothing left to
|
|
2470
3477
|
configure into existence.</p>
|
|
2471
|
-
<h4 id="parameters-
|
|
3478
|
+
<h4 id="parameters-72">Parameters</h4>
|
|
2472
3479
|
<div class="table-scroll">
|
|
2473
3480
|
|
|
2474
3481
|
|
|
@@ -2490,14 +3497,14 @@ configure into existence.</p>
|
|
|
2490
3497
|
|
|
2491
3498
|
|
|
2492
3499
|
|
|
2493
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>app</code></td><td align="left"><code>
|
|
2494
|
-
<h4 id="returns-
|
|
3500
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>app</code></td><td align="left">| <a href="/docs/pyric-app-reference-api/#firebaseapp"><code>FirebaseApp</code></a> | <a href="#sandbox"><code>Sandbox</code></a> | <a href="#sandboxcontext"><code>SandboxContext</code></a></td></tr><tr><td align="left"><code>_settings?</code></td><td align="left"><a href="#firestoresettings"><code>FirestoreSettings</code></a></td></tr><tr><td align="left"><code>_databaseId?</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
3501
|
+
<h4 id="returns-110">Returns</h4>
|
|
2495
3502
|
<p><a href="#firestore"><code>Firestore</code></a></p>
|
|
2496
3503
|
<hr>
|
|
2497
3504
|
<p><a id="limit"></a></p>
|
|
2498
3505
|
<h3 id="limit">limit()</h3>
|
|
2499
3506
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> limit</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">n</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">number</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2500
|
-
<h4 id="parameters-
|
|
3507
|
+
<h4 id="parameters-73">Parameters</h4>
|
|
2501
3508
|
<div class="table-scroll">
|
|
2502
3509
|
|
|
2503
3510
|
|
|
@@ -2512,7 +3519,7 @@ configure into existence.</p>
|
|
|
2512
3519
|
|
|
2513
3520
|
|
|
2514
3521
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>n</code></td><td align="left"><code>number</code></td></tr></tbody></table></div>
|
|
2515
|
-
<h4 id="returns-
|
|
3522
|
+
<h4 id="returns-111">Returns</h4>
|
|
2516
3523
|
<p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
|
|
2517
3524
|
<hr>
|
|
2518
3525
|
<p><a id="limittolast"></a></p>
|
|
@@ -2521,7 +3528,7 @@ configure into existence.</p>
|
|
|
2521
3528
|
<p>Limit the query to the LAST <code>n</code> documents in the ordered result.
|
|
2522
3529
|
Requires at least one <code>orderBy</code> on the query (production-aligned —
|
|
2523
3530
|
the simulator throws at execute time without one).</p>
|
|
2524
|
-
<h4 id="parameters-
|
|
3531
|
+
<h4 id="parameters-74">Parameters</h4>
|
|
2525
3532
|
<div class="table-scroll">
|
|
2526
3533
|
|
|
2527
3534
|
|
|
@@ -2536,14 +3543,14 @@ the simulator throws at execute time without one).</p>
|
|
|
2536
3543
|
|
|
2537
3544
|
|
|
2538
3545
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>n</code></td><td align="left"><code>number</code></td></tr></tbody></table></div>
|
|
2539
|
-
<h4 id="returns-
|
|
3546
|
+
<h4 id="returns-112">Returns</h4>
|
|
2540
3547
|
<p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
|
|
2541
3548
|
<hr>
|
|
2542
3549
|
<p><a id="memoryeagergarbagecollector"></a></p>
|
|
2543
3550
|
<h3 id="memoryeagergarbagecollector">memoryEagerGarbageCollector()</h3>
|
|
2544
3551
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> memoryEagerGarbageCollector</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">MemoryGarbageCollector</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2545
3552
|
<p>Inert config token accepted by <a href="#memorylocalcache">memoryLocalCache</a>’s <code>garbageCollector</code>.</p>
|
|
2546
|
-
<h4 id="returns-
|
|
3553
|
+
<h4 id="returns-113">Returns</h4>
|
|
2547
3554
|
<p><a href="#memorygarbagecollector"><code>MemoryGarbageCollector</code></a></p>
|
|
2548
3555
|
<hr>
|
|
2549
3556
|
<p><a id="memorylocalcache"></a></p>
|
|
@@ -2552,7 +3559,7 @@ the simulator throws at execute time without one).</p>
|
|
|
2552
3559
|
<span class="line"><span style="color:#E06C75"> garbageCollector</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">MemoryGarbageCollector</span><span style="color:#ABB2BF">;</span></span>
|
|
2553
3560
|
<span class="line"><span style="color:#ABB2BF">}): </span><span style="color:#E5C07B">LocalCache</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2554
3561
|
<p>Inert config token — the memory-cache counterpart of <a href="#persistentlocalcache">persistentLocalCache</a>.</p>
|
|
2555
|
-
<h4 id="parameters-
|
|
3562
|
+
<h4 id="parameters-75">Parameters</h4>
|
|
2556
3563
|
<div class="table-scroll">
|
|
2557
3564
|
|
|
2558
3565
|
|
|
@@ -2571,7 +3578,7 @@ the simulator throws at execute time without one).</p>
|
|
|
2571
3578
|
|
|
2572
3579
|
|
|
2573
3580
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>settings?</code></td><td align="left">{ <code>garbageCollector?</code>: <a href="#memorygarbagecollector"><code>MemoryGarbageCollector</code></a>; }</td></tr><tr><td align="left"><code>settings.garbageCollector?</code></td><td align="left"><a href="#memorygarbagecollector"><code>MemoryGarbageCollector</code></a></td></tr></tbody></table></div>
|
|
2574
|
-
<h4 id="returns-
|
|
3581
|
+
<h4 id="returns-114">Returns</h4>
|
|
2575
3582
|
<p><a href="#localcache-1"><code>LocalCache</code></a></p>
|
|
2576
3583
|
<hr>
|
|
2577
3584
|
<p><a id="memorylrugarbagecollector"></a></p>
|
|
@@ -2580,7 +3587,7 @@ the simulator throws at execute time without one).</p>
|
|
|
2580
3587
|
<span class="line"><span style="color:#E06C75"> cacheSizeBytes</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">number</span><span style="color:#ABB2BF">;</span></span>
|
|
2581
3588
|
<span class="line"><span style="color:#ABB2BF">}): </span><span style="color:#E5C07B">MemoryGarbageCollector</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2582
3589
|
<p>Inert config token accepted by <a href="#memorylocalcache">memoryLocalCache</a>’s <code>garbageCollector</code>.</p>
|
|
2583
|
-
<h4 id="parameters-
|
|
3590
|
+
<h4 id="parameters-76">Parameters</h4>
|
|
2584
3591
|
<div class="table-scroll">
|
|
2585
3592
|
|
|
2586
3593
|
|
|
@@ -2599,7 +3606,7 @@ the simulator throws at execute time without one).</p>
|
|
|
2599
3606
|
|
|
2600
3607
|
|
|
2601
3608
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>_settings?</code></td><td align="left">{ <code>cacheSizeBytes?</code>: <code>number</code>; }</td></tr><tr><td align="left"><code>_settings.cacheSizeBytes?</code></td><td align="left"><code>number</code></td></tr></tbody></table></div>
|
|
2602
|
-
<h4 id="returns-
|
|
3609
|
+
<h4 id="returns-115">Returns</h4>
|
|
2603
3610
|
<p><a href="#memorygarbagecollector"><code>MemoryGarbageCollector</code></a></p>
|
|
2604
3611
|
<hr>
|
|
2605
3612
|
<p><a id="onsnapshot"></a></p>
|
|
@@ -2611,7 +3618,7 @@ the simulator throws at execute time without one).</p>
|
|
|
2611
3618
|
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">SnapshotObserver</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">></span></span>
|
|
2612
3619
|
<span class="line"><span style="color:#ABB2BF"> | (</span><span style="color:#E06C75;font-style:italic">snap</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">,</span></span>
|
|
2613
3620
|
<span class="line"><span style="color:#61AFEF"> errorOrNothing</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">error</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Unsubscribe</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2614
|
-
<h5 id="type-parameters-
|
|
3621
|
+
<h5 id="type-parameters-19">Type Parameters</h5>
|
|
2615
3622
|
<div class="table-scroll">
|
|
2616
3623
|
|
|
2617
3624
|
|
|
@@ -2623,8 +3630,8 @@ the simulator throws at execute time without one).</p>
|
|
|
2623
3630
|
|
|
2624
3631
|
|
|
2625
3632
|
|
|
2626
|
-
<table><thead><tr><th align="left">Type Parameter</th></tr></thead><tbody><tr><td align="left"><code>T</code> <em>extends</em> | <a href="#documentreference"><code>DocumentReference</code></a><<code>DocumentData</code>> | <a href="#query"><code>Query</code></a><<code>DocumentData</code>></td></tr></tbody></table></div>
|
|
2627
|
-
<h5 id="parameters-
|
|
3633
|
+
<table><thead><tr><th align="left">Type Parameter</th></tr></thead><tbody><tr><td align="left"><code>T</code> <em>extends</em> | <a href="#documentreference"><code>DocumentReference</code></a><<a href="#documentdata"><code>DocumentData</code></a>> | <a href="#query"><code>Query</code></a><<a href="#documentdata"><code>DocumentData</code></a>></td></tr></tbody></table></div>
|
|
3634
|
+
<h5 id="parameters-77">Parameters</h5>
|
|
2628
3635
|
<div class="table-scroll">
|
|
2629
3636
|
|
|
2630
3637
|
|
|
@@ -2647,7 +3654,7 @@ the simulator throws at execute time without one).</p>
|
|
|
2647
3654
|
|
|
2648
3655
|
|
|
2649
3656
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><code>T</code></td></tr><tr><td align="left"><code>observerOrNext</code></td><td align="left">| <a href="#snapshotobserver"><code>SnapshotObserver</code></a><<code>unknown</code>> | (<code>snap</code>: <code>unknown</code>) => <code>void</code></td></tr><tr><td align="left"><code>errorOrNothing?</code></td><td align="left">(<code>error</code>: <code>unknown</code>) => <code>void</code></td></tr></tbody></table></div>
|
|
2650
|
-
<h5 id="returns-
|
|
3657
|
+
<h5 id="returns-116">Returns</h5>
|
|
2651
3658
|
<p><a href="#unsubscribe"><code>Unsubscribe</code></a></p>
|
|
2652
3659
|
<h4 id="call-signature-13">Call Signature</h4>
|
|
2653
3660
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> onSnapshot</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>(</span></span>
|
|
@@ -2657,7 +3664,7 @@ the simulator throws at execute time without one).</p>
|
|
|
2657
3664
|
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">SnapshotObserver</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">></span></span>
|
|
2658
3665
|
<span class="line"><span style="color:#ABB2BF"> | (</span><span style="color:#E06C75;font-style:italic">snap</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">,</span></span>
|
|
2659
3666
|
<span class="line"><span style="color:#61AFEF"> errorOrNothing</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">error</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Unsubscribe</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2660
|
-
<h5 id="type-parameters-
|
|
3667
|
+
<h5 id="type-parameters-20">Type Parameters</h5>
|
|
2661
3668
|
<div class="table-scroll">
|
|
2662
3669
|
|
|
2663
3670
|
|
|
@@ -2669,8 +3676,8 @@ the simulator throws at execute time without one).</p>
|
|
|
2669
3676
|
|
|
2670
3677
|
|
|
2671
3678
|
|
|
2672
|
-
<table><thead><tr><th align="left">Type Parameter</th></tr></thead><tbody><tr><td align="left"><code>T</code> <em>extends</em> | <a href="#documentreference"><code>DocumentReference</code></a><<code>DocumentData</code>> | <a href="#query"><code>Query</code></a><<code>DocumentData</code>></td></tr></tbody></table></div>
|
|
2673
|
-
<h5 id="parameters-
|
|
3679
|
+
<table><thead><tr><th align="left">Type Parameter</th></tr></thead><tbody><tr><td align="left"><code>T</code> <em>extends</em> | <a href="#documentreference"><code>DocumentReference</code></a><<a href="#documentdata"><code>DocumentData</code></a>> | <a href="#query"><code>Query</code></a><<a href="#documentdata"><code>DocumentData</code></a>></td></tr></tbody></table></div>
|
|
3680
|
+
<h5 id="parameters-78">Parameters</h5>
|
|
2674
3681
|
<div class="table-scroll">
|
|
2675
3682
|
|
|
2676
3683
|
|
|
@@ -2697,7 +3704,7 @@ the simulator throws at execute time without one).</p>
|
|
|
2697
3704
|
|
|
2698
3705
|
|
|
2699
3706
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><code>T</code></td></tr><tr><td align="left"><code>options</code></td><td align="left"><a href="#snapshotlistenoptions"><code>SnapshotListenOptions</code></a></td></tr><tr><td align="left"><code>observerOrNext</code></td><td align="left">| <a href="#snapshotobserver"><code>SnapshotObserver</code></a><<code>unknown</code>> | (<code>snap</code>: <code>unknown</code>) => <code>void</code></td></tr><tr><td align="left"><code>errorOrNothing?</code></td><td align="left">(<code>error</code>: <code>unknown</code>) => <code>void</code></td></tr></tbody></table></div>
|
|
2700
|
-
<h5 id="returns-
|
|
3707
|
+
<h5 id="returns-117">Returns</h5>
|
|
2701
3708
|
<p><a href="#unsubscribe"><code>Unsubscribe</code></a></p>
|
|
2702
3709
|
<hr>
|
|
2703
3710
|
<p><a id="onsnapshotsinsync"></a></p>
|
|
@@ -2715,7 +3722,7 @@ active listener has delivered its latest state” available without a
|
|
|
2715
3722
|
true cross-listener sync signal (the sandbox doesn’t track one).
|
|
2716
3723
|
This is NOT the real SDK’s guarantee (which is scoped to actual
|
|
2717
3724
|
server round-trips); it is scoped to local delivery only.</p>
|
|
2718
|
-
<h4 id="parameters-
|
|
3725
|
+
<h4 id="parameters-79">Parameters</h4>
|
|
2719
3726
|
<div class="table-scroll">
|
|
2720
3727
|
|
|
2721
3728
|
|
|
@@ -2734,7 +3741,7 @@ server round-trips); it is scoped to local delivery only.</p>
|
|
|
2734
3741
|
|
|
2735
3742
|
|
|
2736
3743
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>db</code></td><td align="left"><a href="#firestore"><code>Firestore</code></a></td></tr><tr><td align="left"><code>observerOrCallback</code></td><td align="left">| () => <code>void</code> | { <code>complete?</code>: () => <code>void</code>; <code>error?</code>: (<code>error</code>: <code>unknown</code>) => <code>void</code>; <code>next?</code>: () => <code>void</code>; }</td></tr></tbody></table></div>
|
|
2737
|
-
<h4 id="returns-
|
|
3744
|
+
<h4 id="returns-118">Returns</h4>
|
|
2738
3745
|
<p><a href="#unsubscribe"><code>Unsubscribe</code></a></p>
|
|
2739
3746
|
<hr>
|
|
2740
3747
|
<p><a id="or"></a></p>
|
|
@@ -2745,7 +3752,7 @@ Each argument must itself be a filter constraint (<code>where()</code>, or
|
|
|
2745
3752
|
nested <code>or()</code> / <code>and()</code>); passing <code>orderBy()</code> or <code>limit()</code> here is
|
|
2746
3753
|
a type error at runtime.</p>
|
|
2747
3754
|
<p>Mirrors <code>firebase/firestore</code>’s <code>or(...filters)</code> shape.</p>
|
|
2748
|
-
<h4 id="parameters-
|
|
3755
|
+
<h4 id="parameters-80">Parameters</h4>
|
|
2749
3756
|
<div class="table-scroll">
|
|
2750
3757
|
|
|
2751
3758
|
|
|
@@ -2760,13 +3767,13 @@ a type error at runtime.</p>
|
|
|
2760
3767
|
|
|
2761
3768
|
|
|
2762
3769
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left">…<code>filters</code></td><td align="left"><a href="#queryconstraint"><code>QueryConstraint</code></a>[]</td></tr></tbody></table></div>
|
|
2763
|
-
<h4 id="returns-
|
|
3770
|
+
<h4 id="returns-119">Returns</h4>
|
|
2764
3771
|
<p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
|
|
2765
3772
|
<hr>
|
|
2766
3773
|
<p><a id="orderby"></a></p>
|
|
2767
3774
|
<h3 id="orderby">orderBy()</h3>
|
|
2768
3775
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> orderBy</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">field</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">FieldPath</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">direction</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">OrderDirection</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2769
|
-
<h4 id="parameters-
|
|
3776
|
+
<h4 id="parameters-81">Parameters</h4>
|
|
2770
3777
|
<div class="table-scroll">
|
|
2771
3778
|
|
|
2772
3779
|
|
|
@@ -2784,8 +3791,8 @@ a type error at runtime.</p>
|
|
|
2784
3791
|
|
|
2785
3792
|
|
|
2786
3793
|
|
|
2787
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>field</code></td><td align="left"><code>string</code> | <a href="#fieldpath"><code>FieldPath</code></a></td></tr><tr><td align="left"><code>direction?</code></td><td align="left"><code>OrderDirection</code></td></tr></tbody></table></div>
|
|
2788
|
-
<h4 id="returns-
|
|
3794
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>field</code></td><td align="left"><code>string</code> | <a href="#fieldpath"><code>FieldPath</code></a></td></tr><tr><td align="left"><code>direction?</code></td><td align="left"><a href="#orderdirection"><code>OrderDirection</code></a></td></tr></tbody></table></div>
|
|
3795
|
+
<h4 id="returns-120">Returns</h4>
|
|
2789
3796
|
<p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
|
|
2790
3797
|
<hr>
|
|
2791
3798
|
<p><a id="persistentlocalcache"></a></p>
|
|
@@ -2798,7 +3805,7 @@ a type error at runtime.</p>
|
|
|
2798
3805
|
persistent IndexedDB cache tier; the sandbox has no separate cache
|
|
2799
3806
|
tier — persistence is already the default — so this just returns a
|
|
2800
3807
|
tagged token <code>initializeFirestore</code> can accept without crashing.</p>
|
|
2801
|
-
<h4 id="parameters-
|
|
3808
|
+
<h4 id="parameters-82">Parameters</h4>
|
|
2802
3809
|
<div class="table-scroll">
|
|
2803
3810
|
|
|
2804
3811
|
|
|
@@ -2821,14 +3828,14 @@ tagged token <code>initializeFirestore</code> can accept without crashing.</p>
|
|
|
2821
3828
|
|
|
2822
3829
|
|
|
2823
3830
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>settings?</code></td><td align="left">{ <code>cacheSizeBytes?</code>: <code>number</code>; <code>tabManager?</code>: <a href="#persistenttabmanager"><code>PersistentTabManager</code></a>; }</td></tr><tr><td align="left"><code>settings.cacheSizeBytes?</code></td><td align="left"><code>number</code></td></tr><tr><td align="left"><code>settings.tabManager?</code></td><td align="left"><a href="#persistenttabmanager"><code>PersistentTabManager</code></a></td></tr></tbody></table></div>
|
|
2824
|
-
<h4 id="returns-
|
|
3831
|
+
<h4 id="returns-121">Returns</h4>
|
|
2825
3832
|
<p><a href="#localcache-1"><code>LocalCache</code></a></p>
|
|
2826
3833
|
<hr>
|
|
2827
3834
|
<p><a id="persistentmultipletabmanager"></a></p>
|
|
2828
3835
|
<h3 id="persistentmultipletabmanager">persistentMultipleTabManager()</h3>
|
|
2829
3836
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> persistentMultipleTabManager</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">PersistentTabManager</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2830
3837
|
<p>Inert config token accepted by <a href="#persistentlocalcache">persistentLocalCache</a>’s <code>tabManager</code>.</p>
|
|
2831
|
-
<h4 id="returns-
|
|
3838
|
+
<h4 id="returns-122">Returns</h4>
|
|
2832
3839
|
<p><a href="#persistenttabmanager"><code>PersistentTabManager</code></a></p>
|
|
2833
3840
|
<hr>
|
|
2834
3841
|
<p><a id="persistentsingletabmanager"></a></p>
|
|
@@ -2837,7 +3844,7 @@ tagged token <code>initializeFirestore</code> can accept without crashing.</p>
|
|
|
2837
3844
|
<span class="line"><span style="color:#E06C75"> forceOwnership</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">boolean</span><span style="color:#ABB2BF">;</span></span>
|
|
2838
3845
|
<span class="line"><span style="color:#ABB2BF">}): </span><span style="color:#E5C07B">PersistentTabManager</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2839
3846
|
<p>Inert config token accepted by <a href="#persistentlocalcache">persistentLocalCache</a>’s <code>tabManager</code>.</p>
|
|
2840
|
-
<h4 id="parameters-
|
|
3847
|
+
<h4 id="parameters-83">Parameters</h4>
|
|
2841
3848
|
<div class="table-scroll">
|
|
2842
3849
|
|
|
2843
3850
|
|
|
@@ -2856,7 +3863,7 @@ tagged token <code>initializeFirestore</code> can accept without crashing.</p>
|
|
|
2856
3863
|
|
|
2857
3864
|
|
|
2858
3865
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>_settings?</code></td><td align="left">{ <code>forceOwnership?</code>: <code>boolean</code>; }</td></tr><tr><td align="left"><code>_settings.forceOwnership?</code></td><td align="left"><code>boolean</code></td></tr></tbody></table></div>
|
|
2859
|
-
<h4 id="returns-
|
|
3866
|
+
<h4 id="returns-123">Returns</h4>
|
|
2860
3867
|
<p><a href="#persistenttabmanager"><code>PersistentTabManager</code></a></p>
|
|
2861
3868
|
<hr>
|
|
2862
3869
|
<p><a id="query-1"></a></p>
|
|
@@ -2864,7 +3871,7 @@ tagged token <code>initializeFirestore</code> can accept without crashing.</p>
|
|
|
2864
3871
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> query</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75;font-style:italic">source</span><span style="color:#ABB2BF">:</span></span>
|
|
2865
3872
|
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">CollectionReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">></span></span>
|
|
2866
3873
|
<span class="line"><span style="color:#ABB2BF">| </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>, ...</span><span style="color:#E06C75;font-style:italic">constraints</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">[]): </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>;</span></span></code></pre>
|
|
2867
|
-
<h4 id="type-parameters-
|
|
3874
|
+
<h4 id="type-parameters-21">Type Parameters</h4>
|
|
2868
3875
|
<div class="table-scroll">
|
|
2869
3876
|
|
|
2870
3877
|
|
|
@@ -2878,8 +3885,8 @@ tagged token <code>initializeFirestore</code> can accept without crashing.</p>
|
|
|
2878
3885
|
|
|
2879
3886
|
|
|
2880
3887
|
|
|
2881
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><code>DocumentData</code></td></tr></tbody></table></div>
|
|
2882
|
-
<h4 id="parameters-
|
|
3888
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
3889
|
+
<h4 id="parameters-84">Parameters</h4>
|
|
2883
3890
|
<div class="table-scroll">
|
|
2884
3891
|
|
|
2885
3892
|
|
|
@@ -2898,13 +3905,13 @@ tagged token <code>initializeFirestore</code> can accept without crashing.</p>
|
|
|
2898
3905
|
|
|
2899
3906
|
|
|
2900
3907
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>source</code></td><td align="left">| <a href="#collectionreference"><code>CollectionReference</code></a><<code>T</code>> | <a href="#query"><code>Query</code></a><<code>T</code>></td></tr><tr><td align="left">…<code>constraints</code></td><td align="left"><a href="#queryconstraint"><code>QueryConstraint</code></a>[]</td></tr></tbody></table></div>
|
|
2901
|
-
<h4 id="returns-
|
|
3908
|
+
<h4 id="returns-124">Returns</h4>
|
|
2902
3909
|
<p><a href="#query"><code>Query</code></a><<code>T</code>></p>
|
|
2903
3910
|
<hr>
|
|
2904
3911
|
<p><a id="queryequal"></a></p>
|
|
2905
3912
|
<h3 id="queryequal">queryEqual()</h3>
|
|
2906
3913
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> queryEqual</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">a</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">b</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2907
|
-
<h4 id="parameters-
|
|
3914
|
+
<h4 id="parameters-85">Parameters</h4>
|
|
2908
3915
|
<div class="table-scroll">
|
|
2909
3916
|
|
|
2910
3917
|
|
|
@@ -2923,13 +3930,13 @@ tagged token <code>initializeFirestore</code> can accept without crashing.</p>
|
|
|
2923
3930
|
|
|
2924
3931
|
|
|
2925
3932
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>a</code></td><td align="left"><a href="#query"><code>Query</code></a></td></tr><tr><td align="left"><code>b</code></td><td align="left"><a href="#query"><code>Query</code></a></td></tr></tbody></table></div>
|
|
2926
|
-
<h4 id="returns-
|
|
3933
|
+
<h4 id="returns-125">Returns</h4>
|
|
2927
3934
|
<p><code>boolean</code></p>
|
|
2928
3935
|
<hr>
|
|
2929
3936
|
<p><a id="refequal"></a></p>
|
|
2930
3937
|
<h3 id="refequal">refEqual()</h3>
|
|
2931
3938
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> refEqual</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">a</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DocumentReference</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">b</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DocumentReference</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2932
|
-
<h4 id="parameters-
|
|
3939
|
+
<h4 id="parameters-86">Parameters</h4>
|
|
2933
3940
|
<div class="table-scroll">
|
|
2934
3941
|
|
|
2935
3942
|
|
|
@@ -2948,13 +3955,13 @@ tagged token <code>initializeFirestore</code> can accept without crashing.</p>
|
|
|
2948
3955
|
|
|
2949
3956
|
|
|
2950
3957
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>a</code></td><td align="left"><a href="#documentreference"><code>DocumentReference</code></a></td></tr><tr><td align="left"><code>b</code></td><td align="left"><a href="#documentreference"><code>DocumentReference</code></a></td></tr></tbody></table></div>
|
|
2951
|
-
<h4 id="returns-
|
|
3958
|
+
<h4 id="returns-126">Returns</h4>
|
|
2952
3959
|
<p><code>boolean</code></p>
|
|
2953
3960
|
<hr>
|
|
2954
3961
|
<p><a id="runtransaction"></a></p>
|
|
2955
3962
|
<h3 id="runtransaction">runTransaction()</h3>
|
|
2956
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> runTransaction</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">R</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75;font-style:italic">db</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Firestore</span><span style="color:#ABB2BF">, </span><span style="color:#61AFEF">fn</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">tx</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">
|
|
2957
|
-
<h4 id="type-parameters-
|
|
3963
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> runTransaction</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">R</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75;font-style:italic">db</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Firestore</span><span style="color:#ABB2BF">, </span><span style="color:#61AFEF">fn</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">tx</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Transaction</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> R</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">R</span><span style="color:#ABB2BF">>): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">R</span><span style="color:#ABB2BF">>;</span></span></code></pre>
|
|
3964
|
+
<h4 id="type-parameters-22">Type Parameters</h4>
|
|
2958
3965
|
<div class="table-scroll">
|
|
2959
3966
|
|
|
2960
3967
|
|
|
@@ -2967,7 +3974,7 @@ tagged token <code>initializeFirestore</code> can accept without crashing.</p>
|
|
|
2967
3974
|
|
|
2968
3975
|
|
|
2969
3976
|
<table><thead><tr><th align="left">Type Parameter</th></tr></thead><tbody><tr><td align="left"><code>R</code></td></tr></tbody></table></div>
|
|
2970
|
-
<h4 id="parameters-
|
|
3977
|
+
<h4 id="parameters-87">Parameters</h4>
|
|
2971
3978
|
<div class="table-scroll">
|
|
2972
3979
|
|
|
2973
3980
|
|
|
@@ -2985,15 +3992,15 @@ tagged token <code>initializeFirestore</code> can accept without crashing.</p>
|
|
|
2985
3992
|
|
|
2986
3993
|
|
|
2987
3994
|
|
|
2988
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>db</code></td><td align="left"><a href="#firestore"><code>Firestore</code></a></td></tr><tr><td align="left"><code>fn</code></td><td align="left">(<code>tx</code>: <code>
|
|
2989
|
-
<h4 id="returns-
|
|
3995
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>db</code></td><td align="left"><a href="#firestore"><code>Firestore</code></a></td></tr><tr><td align="left"><code>fn</code></td><td align="left">(<code>tx</code>: <a href="/docs/pyric-admin-firestore-reference-api/#transaction"><code>Transaction</code></a>) => <code>R</code> | <code>Promise</code><<code>R</code>></td></tr></tbody></table></div>
|
|
3996
|
+
<h4 id="returns-127">Returns</h4>
|
|
2990
3997
|
<p><code>Promise</code><<code>R</code>></p>
|
|
2991
3998
|
<hr>
|
|
2992
|
-
<p><a id="servertimestamp"></a></p>
|
|
2993
|
-
<h3 id="servertimestamp">serverTimestamp()</h3>
|
|
3999
|
+
<p><a id="servertimestamp-2"></a></p>
|
|
4000
|
+
<h3 id="servertimestamp-1">serverTimestamp()</h3>
|
|
2994
4001
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> serverTimestamp</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">FieldValueSentinel</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
2995
|
-
<h4 id="returns-
|
|
2996
|
-
<p><code>FieldValueSentinel</code></p>
|
|
4002
|
+
<h4 id="returns-128">Returns</h4>
|
|
4003
|
+
<p><a href="#fieldvaluesentinel"><code>FieldValueSentinel</code></a></p>
|
|
2997
4004
|
<hr>
|
|
2998
4005
|
<p><a id="setdoc"></a></p>
|
|
2999
4006
|
<h3 id="setdoc">setDoc()</h3>
|
|
@@ -3001,7 +4008,7 @@ tagged token <code>initializeFirestore</code> can accept without crashing.</p>
|
|
|
3001
4008
|
<span class="line"><span style="color:#E06C75;font-style:italic"> ref</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DocumentReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>,</span></span>
|
|
3002
4009
|
<span class="line"><span style="color:#E06C75;font-style:italic"> data</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">,</span></span>
|
|
3003
4010
|
<span class="line"><span style="color:#E06C75;font-style:italic">options</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">SetOptions</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">>;</span></span></code></pre>
|
|
3004
|
-
<h4 id="type-parameters-
|
|
4011
|
+
<h4 id="type-parameters-23">Type Parameters</h4>
|
|
3005
4012
|
<div class="table-scroll">
|
|
3006
4013
|
|
|
3007
4014
|
|
|
@@ -3015,8 +4022,8 @@ tagged token <code>initializeFirestore</code> can accept without crashing.</p>
|
|
|
3015
4022
|
|
|
3016
4023
|
|
|
3017
4024
|
|
|
3018
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><code>DocumentData</code></td></tr></tbody></table></div>
|
|
3019
|
-
<h4 id="parameters-
|
|
4025
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>T</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
4026
|
+
<h4 id="parameters-88">Parameters</h4>
|
|
3020
4027
|
<div class="table-scroll">
|
|
3021
4028
|
|
|
3022
4029
|
|
|
@@ -3039,7 +4046,7 @@ tagged token <code>initializeFirestore</code> can accept without crashing.</p>
|
|
|
3039
4046
|
|
|
3040
4047
|
|
|
3041
4048
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><a href="#documentreference"><code>DocumentReference</code></a><<code>T</code>></td></tr><tr><td align="left"><code>data</code></td><td align="left"><code>T</code></td></tr><tr><td align="left"><code>options?</code></td><td align="left"><a href="#setoptions"><code>SetOptions</code></a></td></tr></tbody></table></div>
|
|
3042
|
-
<h4 id="returns-
|
|
4049
|
+
<h4 id="returns-129">Returns</h4>
|
|
3043
4050
|
<p><code>Promise</code><<code>void</code>></p>
|
|
3044
4051
|
<hr>
|
|
3045
4052
|
<p><a id="setloglevel"></a></p>
|
|
@@ -3050,7 +4057,7 @@ a level into (it uses host-level <code>console</code> logging directly, gated
|
|
|
3050
4057
|
by <code>pyric dev</code>’s own flags, not this call). Exists purely so app
|
|
3051
4058
|
code that calls this defensively at startup doesn’t crash on a
|
|
3052
4059
|
missing export.</p>
|
|
3053
|
-
<h4 id="parameters-
|
|
4060
|
+
<h4 id="parameters-89">Parameters</h4>
|
|
3054
4061
|
<div class="table-scroll">
|
|
3055
4062
|
|
|
3056
4063
|
|
|
@@ -3065,7 +4072,7 @@ missing export.</p>
|
|
|
3065
4072
|
|
|
3066
4073
|
|
|
3067
4074
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>logLevel</code></td><td align="left"><a href="#loglevel"><code>LogLevel</code></a></td></tr></tbody></table></div>
|
|
3068
|
-
<h4 id="returns-
|
|
4075
|
+
<h4 id="returns-130">Returns</h4>
|
|
3069
4076
|
<p><code>void</code></p>
|
|
3070
4077
|
<hr>
|
|
3071
4078
|
<p><a id="snapshotequal"></a></p>
|
|
@@ -3075,7 +4082,7 @@ missing export.</p>
|
|
|
3075
4082
|
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">QuerySnapshot</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">DocumentData</span><span style="color:#ABB2BF">>, </span><span style="color:#E06C75;font-style:italic">b</span><span style="color:#ABB2BF">:</span></span>
|
|
3076
4083
|
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">DocumentSnapshot</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">DocumentData</span><span style="color:#ABB2BF">></span></span>
|
|
3077
4084
|
<span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">QuerySnapshot</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">DocumentData</span><span style="color:#ABB2BF">>): </span><span style="color:#E5C07B">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
3078
|
-
<h4 id="parameters-
|
|
4085
|
+
<h4 id="parameters-90">Parameters</h4>
|
|
3079
4086
|
<div class="table-scroll">
|
|
3080
4087
|
|
|
3081
4088
|
|
|
@@ -3093,8 +4100,8 @@ missing export.</p>
|
|
|
3093
4100
|
|
|
3094
4101
|
|
|
3095
4102
|
|
|
3096
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>a</code></td><td align="left">| <a href="#documentsnapshot"><code>DocumentSnapshot</code></a><<code>DocumentData</code>> | <a href="#querysnapshot"><code>QuerySnapshot</code></a><<code>DocumentData</code>></td></tr><tr><td align="left"><code>b</code></td><td align="left">| <a href="#documentsnapshot"><code>DocumentSnapshot</code></a><<code>DocumentData</code>> | <a href="#querysnapshot"><code>QuerySnapshot</code></a><<code>DocumentData</code>></td></tr></tbody></table></div>
|
|
3097
|
-
<h4 id="returns-
|
|
4103
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>a</code></td><td align="left">| <a href="#documentsnapshot"><code>DocumentSnapshot</code></a><<a href="#documentdata"><code>DocumentData</code></a>> | <a href="#querysnapshot"><code>QuerySnapshot</code></a><<a href="#documentdata"><code>DocumentData</code></a>></td></tr><tr><td align="left"><code>b</code></td><td align="left">| <a href="#documentsnapshot"><code>DocumentSnapshot</code></a><<a href="#documentdata"><code>DocumentData</code></a>> | <a href="#querysnapshot"><code>QuerySnapshot</code></a><<a href="#documentdata"><code>DocumentData</code></a>></td></tr></tbody></table></div>
|
|
4104
|
+
<h4 id="returns-131">Returns</h4>
|
|
3098
4105
|
<p><code>boolean</code></p>
|
|
3099
4106
|
<hr>
|
|
3100
4107
|
<p><a id="startafter"></a></p>
|
|
@@ -3103,7 +4110,7 @@ missing export.</p>
|
|
|
3103
4110
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> startAfter</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">snapshot</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DocumentSnapshot</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
3104
4111
|
<p>Same as <code>startAt</code>, but EXCLUDES the document at the cursor — the
|
|
3105
4112
|
result starts at the next ordered position.</p>
|
|
3106
|
-
<h5 id="parameters-
|
|
4113
|
+
<h5 id="parameters-91">Parameters</h5>
|
|
3107
4114
|
<div class="table-scroll">
|
|
3108
4115
|
|
|
3109
4116
|
|
|
@@ -3118,13 +4125,13 @@ result starts at the next ordered position.</p>
|
|
|
3118
4125
|
|
|
3119
4126
|
|
|
3120
4127
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>snapshot</code></td><td align="left"><a href="#documentsnapshot"><code>DocumentSnapshot</code></a></td></tr></tbody></table></div>
|
|
3121
|
-
<h5 id="returns-
|
|
4128
|
+
<h5 id="returns-132">Returns</h5>
|
|
3122
4129
|
<p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
|
|
3123
4130
|
<h4 id="call-signature-15">Call Signature</h4>
|
|
3124
4131
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> startAfter</span><span style="color:#ABB2BF">(...</span><span style="color:#E06C75;font-style:italic">values</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">[]): </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
3125
4132
|
<p>Same as <code>startAt</code>, but EXCLUDES the document at the cursor — the
|
|
3126
4133
|
result starts at the next ordered position.</p>
|
|
3127
|
-
<h5 id="parameters-
|
|
4134
|
+
<h5 id="parameters-92">Parameters</h5>
|
|
3128
4135
|
<div class="table-scroll">
|
|
3129
4136
|
|
|
3130
4137
|
|
|
@@ -3139,7 +4146,7 @@ result starts at the next ordered position.</p>
|
|
|
3139
4146
|
|
|
3140
4147
|
|
|
3141
4148
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left">…<code>values</code></td><td align="left"><code>unknown</code>[]</td></tr></tbody></table></div>
|
|
3142
|
-
<h5 id="returns-
|
|
4149
|
+
<h5 id="returns-133">Returns</h5>
|
|
3143
4150
|
<p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
|
|
3144
4151
|
<hr>
|
|
3145
4152
|
<p><a id="startat"></a></p>
|
|
@@ -3153,7 +4160,7 @@ the result. Two overloads:</p>
|
|
|
3153
4160
|
by the query’s orderBy fields.
|
|
3154
4161
|
<code>startAt(...values)</code> — explicit positional values (one per
|
|
3155
4162
|
orderBy clause).</p>
|
|
3156
|
-
<h5 id="parameters-
|
|
4163
|
+
<h5 id="parameters-93">Parameters</h5>
|
|
3157
4164
|
<div class="table-scroll">
|
|
3158
4165
|
|
|
3159
4166
|
|
|
@@ -3168,7 +4175,7 @@ orderBy clause).</p>
|
|
|
3168
4175
|
|
|
3169
4176
|
|
|
3170
4177
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>snapshot</code></td><td align="left"><a href="#documentsnapshot"><code>DocumentSnapshot</code></a></td></tr></tbody></table></div>
|
|
3171
|
-
<h5 id="returns-
|
|
4178
|
+
<h5 id="returns-134">Returns</h5>
|
|
3172
4179
|
<p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
|
|
3173
4180
|
<h4 id="call-signature-17">Call Signature</h4>
|
|
3174
4181
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> startAt</span><span style="color:#ABB2BF">(...</span><span style="color:#E06C75;font-style:italic">values</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">[]): </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
@@ -3179,7 +4186,7 @@ the result. Two overloads:</p>
|
|
|
3179
4186
|
by the query’s orderBy fields.
|
|
3180
4187
|
<code>startAt(...values)</code> — explicit positional values (one per
|
|
3181
4188
|
orderBy clause).</p>
|
|
3182
|
-
<h5 id="parameters-
|
|
4189
|
+
<h5 id="parameters-94">Parameters</h5>
|
|
3183
4190
|
<div class="table-scroll">
|
|
3184
4191
|
|
|
3185
4192
|
|
|
@@ -3194,14 +4201,14 @@ orderBy clause).</p>
|
|
|
3194
4201
|
|
|
3195
4202
|
|
|
3196
4203
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left">…<code>values</code></td><td align="left"><code>unknown</code>[]</td></tr></tbody></table></div>
|
|
3197
|
-
<h5 id="returns-
|
|
4204
|
+
<h5 id="returns-135">Returns</h5>
|
|
3198
4205
|
<p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
|
|
3199
4206
|
<hr>
|
|
3200
4207
|
<p><a id="sum"></a></p>
|
|
3201
4208
|
<h3 id="sum">sum()</h3>
|
|
3202
4209
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> sum</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">field</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">AggregateField</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
3203
4210
|
<p>Factory: sum-of-<code>field</code> aggregate.</p>
|
|
3204
|
-
<h4 id="parameters-
|
|
4211
|
+
<h4 id="parameters-95">Parameters</h4>
|
|
3205
4212
|
<div class="table-scroll">
|
|
3206
4213
|
|
|
3207
4214
|
|
|
@@ -3216,7 +4223,7 @@ orderBy clause).</p>
|
|
|
3216
4223
|
|
|
3217
4224
|
|
|
3218
4225
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>field</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
|
|
3219
|
-
<h4 id="returns-
|
|
4226
|
+
<h4 id="returns-136">Returns</h4>
|
|
3220
4227
|
<p><a href="#aggregatefield"><code>AggregateField</code></a></p>
|
|
3221
4228
|
<hr>
|
|
3222
4229
|
<p><a id="terminate"></a></p>
|
|
@@ -3235,7 +4242,7 @@ Firestore-only slice of it — if <code>pyric/database</code> or <code>pyric/sto
|
|
|
3235
4242
|
share the same <code>Sandbox</code>, their listener registries are torn down
|
|
3236
4243
|
too. This differs from the real SDK, where <code>terminate()</code> only
|
|
3237
4244
|
affects the one <code>Firestore</code> instance. Documented divergence.</p>
|
|
3238
|
-
<h4 id="parameters-
|
|
4245
|
+
<h4 id="parameters-96">Parameters</h4>
|
|
3239
4246
|
<div class="table-scroll">
|
|
3240
4247
|
|
|
3241
4248
|
|
|
@@ -3250,7 +4257,7 @@ affects the one <code>Firestore</code> instance. Documented divergence.</p>
|
|
|
3250
4257
|
|
|
3251
4258
|
|
|
3252
4259
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>db</code></td><td align="left"><a href="#firestore"><code>Firestore</code></a></td></tr></tbody></table></div>
|
|
3253
|
-
<h4 id="returns-
|
|
4260
|
+
<h4 id="returns-137">Returns</h4>
|
|
3254
4261
|
<p><code>Promise</code><<code>void</code>></p>
|
|
3255
4262
|
<hr>
|
|
3256
4263
|
<p><a id="updatedoc"></a></p>
|
|
@@ -3261,7 +4268,7 @@ Web SDK shape — partial updates can target any subset of fields, so
|
|
|
3261
4268
|
a translator built around a full <code>AppModelType</code> would be a type-shape
|
|
3262
4269
|
mismatch. Use the underlying <code>DocumentData</code> view (<code>withConverter(ref, null)</code>) for typed-and-untyped mixed access if you need both styles
|
|
3263
4270
|
against the same path.</p>
|
|
3264
|
-
<h4 id="parameters-
|
|
4271
|
+
<h4 id="parameters-97">Parameters</h4>
|
|
3265
4272
|
<div class="table-scroll">
|
|
3266
4273
|
|
|
3267
4274
|
|
|
@@ -3279,14 +4286,14 @@ against the same path.</p>
|
|
|
3279
4286
|
|
|
3280
4287
|
|
|
3281
4288
|
|
|
3282
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><a href="#documentreference"><code>DocumentReference</code></a></td></tr><tr><td align="left"><code>data</code></td><td align="left"><code>DocumentData</code></td></tr></tbody></table></div>
|
|
3283
|
-
<h4 id="returns-
|
|
4289
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><a href="#documentreference"><code>DocumentReference</code></a></td></tr><tr><td align="left"><code>data</code></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
4290
|
+
<h4 id="returns-138">Returns</h4>
|
|
3284
4291
|
<p><code>Promise</code><<code>void</code>></p>
|
|
3285
4292
|
<hr>
|
|
3286
4293
|
<p><a id="vector"></a></p>
|
|
3287
4294
|
<h3 id="vector">vector()</h3>
|
|
3288
4295
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> vector</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">values</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">number</span><span style="color:#ABB2BF">[]): </span><span style="color:#E5C07B">VectorValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
3289
|
-
<h4 id="parameters-
|
|
4296
|
+
<h4 id="parameters-98">Parameters</h4>
|
|
3290
4297
|
<div class="table-scroll">
|
|
3291
4298
|
|
|
3292
4299
|
|
|
@@ -3301,7 +4308,7 @@ against the same path.</p>
|
|
|
3301
4308
|
|
|
3302
4309
|
|
|
3303
4310
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>values?</code></td><td align="left"><code>number</code>[]</td></tr></tbody></table></div>
|
|
3304
|
-
<h4 id="returns-
|
|
4311
|
+
<h4 id="returns-139">Returns</h4>
|
|
3305
4312
|
<p><a href="#vectorvalue"><code>VectorValue</code></a></p>
|
|
3306
4313
|
<hr>
|
|
3307
4314
|
<p><a id="waitforpendingwrites"></a></p>
|
|
@@ -3313,7 +4320,7 @@ on — every write it accepts is already committed to the local store
|
|
|
3313
4320
|
by the time the write’s own promise resolves, so by the time this is
|
|
3314
4321
|
called there are, honestly, never any writes still pending a round
|
|
3315
4322
|
trip.</p>
|
|
3316
|
-
<h4 id="parameters-
|
|
4323
|
+
<h4 id="parameters-99">Parameters</h4>
|
|
3317
4324
|
<div class="table-scroll">
|
|
3318
4325
|
|
|
3319
4326
|
|
|
@@ -3328,7 +4335,7 @@ trip.</p>
|
|
|
3328
4335
|
|
|
3329
4336
|
|
|
3330
4337
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>db</code></td><td align="left"><a href="#firestore"><code>Firestore</code></a></td></tr></tbody></table></div>
|
|
3331
|
-
<h4 id="returns-
|
|
4338
|
+
<h4 id="returns-140">Returns</h4>
|
|
3332
4339
|
<p><code>Promise</code><<code>void</code>></p>
|
|
3333
4340
|
<hr>
|
|
3334
4341
|
<p><a id="where"></a></p>
|
|
@@ -3337,7 +4344,7 @@ trip.</p>
|
|
|
3337
4344
|
<span class="line"><span style="color:#E06C75;font-style:italic"> field</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">FieldPath</span><span style="color:#ABB2BF">,</span></span>
|
|
3338
4345
|
<span class="line"><span style="color:#E06C75;font-style:italic"> op</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">WhereFilterOp</span><span style="color:#ABB2BF">,</span></span>
|
|
3339
4346
|
<span class="line"><span style="color:#E06C75;font-style:italic"> value</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
3340
|
-
<h4 id="parameters-
|
|
4347
|
+
<h4 id="parameters-100">Parameters</h4>
|
|
3341
4348
|
<div class="table-scroll">
|
|
3342
4349
|
|
|
3343
4350
|
|
|
@@ -3359,15 +4366,15 @@ trip.</p>
|
|
|
3359
4366
|
|
|
3360
4367
|
|
|
3361
4368
|
|
|
3362
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>field</code></td><td align="left"><code>string</code> | <a href="#fieldpath"><code>FieldPath</code></a></td></tr><tr><td align="left"><code>op</code></td><td align="left"><code>WhereFilterOp</code></td></tr><tr><td align="left"><code>value</code></td><td align="left"><code>unknown</code></td></tr></tbody></table></div>
|
|
3363
|
-
<h4 id="returns-
|
|
4369
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>field</code></td><td align="left"><code>string</code> | <a href="#fieldpath"><code>FieldPath</code></a></td></tr><tr><td align="left"><code>op</code></td><td align="left"><a href="#wherefilterop"><code>WhereFilterOp</code></a></td></tr><tr><td align="left"><code>value</code></td><td align="left"><code>unknown</code></td></tr></tbody></table></div>
|
|
4370
|
+
<h4 id="returns-141">Returns</h4>
|
|
3364
4371
|
<p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
|
|
3365
4372
|
<hr>
|
|
3366
4373
|
<p><a id="withconverter"></a></p>
|
|
3367
4374
|
<h3 id="withconverter">withConverter()</h3>
|
|
3368
4375
|
<h4 id="call-signature-18">Call Signature</h4>
|
|
3369
4376
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> withConverter</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">AppModel</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">DbModel</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75;font-style:italic">ref</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DocumentReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">DocumentData</span><span style="color:#ABB2BF">>, </span><span style="color:#E06C75;font-style:italic">converter</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">FirestoreDataConverter</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">AppModel</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">DbModel</span><span style="color:#ABB2BF">>): </span><span style="color:#E5C07B">DocumentReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">AppModel</span><span style="color:#ABB2BF">>;</span></span></code></pre>
|
|
3370
|
-
<h5 id="type-parameters-
|
|
4377
|
+
<h5 id="type-parameters-24">Type Parameters</h5>
|
|
3371
4378
|
<div class="table-scroll">
|
|
3372
4379
|
|
|
3373
4380
|
|
|
@@ -3385,8 +4392,8 @@ trip.</p>
|
|
|
3385
4392
|
|
|
3386
4393
|
|
|
3387
4394
|
|
|
3388
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>AppModel</code></td><td align="left">-</td></tr><tr><td align="left"><code>DbModel</code> <em>extends</em> <code>DocumentData</code></td><td align="left"><code>DocumentData</code></td></tr></tbody></table></div>
|
|
3389
|
-
<h5 id="parameters-
|
|
4395
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>AppModel</code></td><td align="left">-</td></tr><tr><td align="left"><code>DbModel</code> <em>extends</em> <a href="#documentdata"><code>DocumentData</code></a></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
4396
|
+
<h5 id="parameters-101">Parameters</h5>
|
|
3390
4397
|
<div class="table-scroll">
|
|
3391
4398
|
|
|
3392
4399
|
|
|
@@ -3404,12 +4411,12 @@ trip.</p>
|
|
|
3404
4411
|
|
|
3405
4412
|
|
|
3406
4413
|
|
|
3407
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><a href="#documentreference"><code>DocumentReference</code></a><<code>DocumentData</code>></td></tr><tr><td align="left"><code>converter</code></td><td align="left"><a href="#firestoredataconverter"><code>FirestoreDataConverter</code></a><<code>AppModel</code>, <code>DbModel</code>></td></tr></tbody></table></div>
|
|
3408
|
-
<h5 id="returns-
|
|
4414
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><a href="#documentreference"><code>DocumentReference</code></a><<a href="#documentdata"><code>DocumentData</code></a>></td></tr><tr><td align="left"><code>converter</code></td><td align="left"><a href="#firestoredataconverter"><code>FirestoreDataConverter</code></a><<code>AppModel</code>, <code>DbModel</code>></td></tr></tbody></table></div>
|
|
4415
|
+
<h5 id="returns-142">Returns</h5>
|
|
3409
4416
|
<p><a href="#documentreference"><code>DocumentReference</code></a><<code>AppModel</code>></p>
|
|
3410
4417
|
<h4 id="call-signature-19">Call Signature</h4>
|
|
3411
4418
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> withConverter</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">ref</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DocumentReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">>, </span><span style="color:#E06C75;font-style:italic">converter</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">null</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">DocumentReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">DocumentData</span><span style="color:#ABB2BF">>;</span></span></code></pre>
|
|
3412
|
-
<h5 id="parameters-
|
|
4419
|
+
<h5 id="parameters-102">Parameters</h5>
|
|
3413
4420
|
<div class="table-scroll">
|
|
3414
4421
|
|
|
3415
4422
|
|
|
@@ -3428,11 +4435,11 @@ trip.</p>
|
|
|
3428
4435
|
|
|
3429
4436
|
|
|
3430
4437
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><a href="#documentreference"><code>DocumentReference</code></a><<code>unknown</code>></td></tr><tr><td align="left"><code>converter</code></td><td align="left"><code>null</code></td></tr></tbody></table></div>
|
|
3431
|
-
<h5 id="returns-
|
|
3432
|
-
<p><a href="#documentreference"><code>DocumentReference</code></a><<code>DocumentData</code>></p>
|
|
4438
|
+
<h5 id="returns-143">Returns</h5>
|
|
4439
|
+
<p><a href="#documentreference"><code>DocumentReference</code></a><<a href="#documentdata"><code>DocumentData</code></a>></p>
|
|
3433
4440
|
<h4 id="call-signature-20">Call Signature</h4>
|
|
3434
4441
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> withConverter</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">AppModel</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">DbModel</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75;font-style:italic">ref</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">CollectionReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">DocumentData</span><span style="color:#ABB2BF">>, </span><span style="color:#E06C75;font-style:italic">converter</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">FirestoreDataConverter</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">AppModel</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">DbModel</span><span style="color:#ABB2BF">>): </span><span style="color:#E5C07B">CollectionReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">AppModel</span><span style="color:#ABB2BF">>;</span></span></code></pre>
|
|
3435
|
-
<h5 id="type-parameters-
|
|
4442
|
+
<h5 id="type-parameters-25">Type Parameters</h5>
|
|
3436
4443
|
<div class="table-scroll">
|
|
3437
4444
|
|
|
3438
4445
|
|
|
@@ -3450,8 +4457,8 @@ trip.</p>
|
|
|
3450
4457
|
|
|
3451
4458
|
|
|
3452
4459
|
|
|
3453
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>AppModel</code></td><td align="left">-</td></tr><tr><td align="left"><code>DbModel</code> <em>extends</em> <code>DocumentData</code></td><td align="left"><code>DocumentData</code></td></tr></tbody></table></div>
|
|
3454
|
-
<h5 id="parameters-
|
|
4460
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>AppModel</code></td><td align="left">-</td></tr><tr><td align="left"><code>DbModel</code> <em>extends</em> <a href="#documentdata"><code>DocumentData</code></a></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
4461
|
+
<h5 id="parameters-103">Parameters</h5>
|
|
3455
4462
|
<div class="table-scroll">
|
|
3456
4463
|
|
|
3457
4464
|
|
|
@@ -3469,12 +4476,12 @@ trip.</p>
|
|
|
3469
4476
|
|
|
3470
4477
|
|
|
3471
4478
|
|
|
3472
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><a href="#collectionreference"><code>CollectionReference</code></a><<code>DocumentData</code>></td></tr><tr><td align="left"><code>converter</code></td><td align="left"><a href="#firestoredataconverter"><code>FirestoreDataConverter</code></a><<code>AppModel</code>, <code>DbModel</code>></td></tr></tbody></table></div>
|
|
3473
|
-
<h5 id="returns-
|
|
4479
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><a href="#collectionreference"><code>CollectionReference</code></a><<a href="#documentdata"><code>DocumentData</code></a>></td></tr><tr><td align="left"><code>converter</code></td><td align="left"><a href="#firestoredataconverter"><code>FirestoreDataConverter</code></a><<code>AppModel</code>, <code>DbModel</code>></td></tr></tbody></table></div>
|
|
4480
|
+
<h5 id="returns-144">Returns</h5>
|
|
3474
4481
|
<p><a href="#collectionreference"><code>CollectionReference</code></a><<code>AppModel</code>></p>
|
|
3475
4482
|
<h4 id="call-signature-21">Call Signature</h4>
|
|
3476
4483
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> withConverter</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">ref</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">CollectionReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">>, </span><span style="color:#E06C75;font-style:italic">converter</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">null</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">CollectionReference</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">DocumentData</span><span style="color:#ABB2BF">>;</span></span></code></pre>
|
|
3477
|
-
<h5 id="parameters-
|
|
4484
|
+
<h5 id="parameters-104">Parameters</h5>
|
|
3478
4485
|
<div class="table-scroll">
|
|
3479
4486
|
|
|
3480
4487
|
|
|
@@ -3493,11 +4500,11 @@ trip.</p>
|
|
|
3493
4500
|
|
|
3494
4501
|
|
|
3495
4502
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>ref</code></td><td align="left"><a href="#collectionreference"><code>CollectionReference</code></a><<code>unknown</code>></td></tr><tr><td align="left"><code>converter</code></td><td align="left"><code>null</code></td></tr></tbody></table></div>
|
|
3496
|
-
<h5 id="returns-
|
|
3497
|
-
<p><a href="#collectionreference"><code>CollectionReference</code></a><<code>DocumentData</code>></p>
|
|
4503
|
+
<h5 id="returns-145">Returns</h5>
|
|
4504
|
+
<p><a href="#collectionreference"><code>CollectionReference</code></a><<a href="#documentdata"><code>DocumentData</code></a>></p>
|
|
3498
4505
|
<h4 id="call-signature-22">Call Signature</h4>
|
|
3499
4506
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> withConverter</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">AppModel</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">DbModel</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75;font-style:italic">q</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">DocumentData</span><span style="color:#ABB2BF">>, </span><span style="color:#E06C75;font-style:italic">converter</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">FirestoreDataConverter</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">AppModel</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">DbModel</span><span style="color:#ABB2BF">>): </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">AppModel</span><span style="color:#ABB2BF">>;</span></span></code></pre>
|
|
3500
|
-
<h5 id="type-parameters-
|
|
4507
|
+
<h5 id="type-parameters-26">Type Parameters</h5>
|
|
3501
4508
|
<div class="table-scroll">
|
|
3502
4509
|
|
|
3503
4510
|
|
|
@@ -3515,8 +4522,8 @@ trip.</p>
|
|
|
3515
4522
|
|
|
3516
4523
|
|
|
3517
4524
|
|
|
3518
|
-
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>AppModel</code></td><td align="left">-</td></tr><tr><td align="left"><code>DbModel</code> <em>extends</em> <code>DocumentData</code></td><td align="left"><code>DocumentData</code></td></tr></tbody></table></div>
|
|
3519
|
-
<h5 id="parameters-
|
|
4525
|
+
<table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>AppModel</code></td><td align="left">-</td></tr><tr><td align="left"><code>DbModel</code> <em>extends</em> <a href="#documentdata"><code>DocumentData</code></a></td><td align="left"><a href="#documentdata"><code>DocumentData</code></a></td></tr></tbody></table></div>
|
|
4526
|
+
<h5 id="parameters-105">Parameters</h5>
|
|
3520
4527
|
<div class="table-scroll">
|
|
3521
4528
|
|
|
3522
4529
|
|
|
@@ -3534,12 +4541,12 @@ trip.</p>
|
|
|
3534
4541
|
|
|
3535
4542
|
|
|
3536
4543
|
|
|
3537
|
-
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>q</code></td><td align="left"><a href="#query"><code>Query</code></a><<code>DocumentData</code>></td></tr><tr><td align="left"><code>converter</code></td><td align="left"><a href="#firestoredataconverter"><code>FirestoreDataConverter</code></a><<code>AppModel</code>, <code>DbModel</code>></td></tr></tbody></table></div>
|
|
3538
|
-
<h5 id="returns-
|
|
4544
|
+
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>q</code></td><td align="left"><a href="#query"><code>Query</code></a><<a href="#documentdata"><code>DocumentData</code></a>></td></tr><tr><td align="left"><code>converter</code></td><td align="left"><a href="#firestoredataconverter"><code>FirestoreDataConverter</code></a><<code>AppModel</code>, <code>DbModel</code>></td></tr></tbody></table></div>
|
|
4545
|
+
<h5 id="returns-146">Returns</h5>
|
|
3539
4546
|
<p><a href="#query"><code>Query</code></a><<code>AppModel</code>></p>
|
|
3540
4547
|
<h4 id="call-signature-23">Call Signature</h4>
|
|
3541
4548
|
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> withConverter</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">q</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">>, </span><span style="color:#E06C75;font-style:italic">converter</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">null</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"><</span><span style="color:#E5C07B">DocumentData</span><span style="color:#ABB2BF">>;</span></span></code></pre>
|
|
3542
|
-
<h5 id="parameters-
|
|
4549
|
+
<h5 id="parameters-106">Parameters</h5>
|
|
3543
4550
|
<div class="table-scroll">
|
|
3544
4551
|
|
|
3545
4552
|
|
|
@@ -3558,13 +4565,13 @@ trip.</p>
|
|
|
3558
4565
|
|
|
3559
4566
|
|
|
3560
4567
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>q</code></td><td align="left"><a href="#query"><code>Query</code></a><<code>unknown</code>></td></tr><tr><td align="left"><code>converter</code></td><td align="left"><code>null</code></td></tr></tbody></table></div>
|
|
3561
|
-
<h5 id="returns-
|
|
3562
|
-
<p><a href="#query"><code>Query</code></a><<code>DocumentData</code>></p>
|
|
4568
|
+
<h5 id="returns-147">Returns</h5>
|
|
4569
|
+
<p><a href="#query"><code>Query</code></a><<a href="#documentdata"><code>DocumentData</code></a>></p>
|
|
3563
4570
|
<hr>
|
|
3564
4571
|
<p><a id="writebatch-1"></a></p>
|
|
3565
4572
|
<h3 id="writebatch-1">writeBatch()</h3>
|
|
3566
|
-
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> writeBatch</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">db</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Firestore</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">
|
|
3567
|
-
<h4 id="parameters-
|
|
4573
|
+
<pre class="astro-code one-dark-pro" style="background-color:#282c34;color:#abb2bf; overflow-x: auto;" tabindex="0" data-language="ts"><code><span class="line"><span style="color:#C678DD">function</span><span style="color:#61AFEF"> writeBatch</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">db</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Firestore</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">WriteBatch</span><span style="color:#ABB2BF">;</span></span></code></pre>
|
|
4574
|
+
<h4 id="parameters-107">Parameters</h4>
|
|
3568
4575
|
<div class="table-scroll">
|
|
3569
4576
|
|
|
3570
4577
|
|
|
@@ -3579,45 +4586,5 @@ trip.</p>
|
|
|
3579
4586
|
|
|
3580
4587
|
|
|
3581
4588
|
<table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>db</code></td><td align="left"><a href="#firestore"><code>Firestore</code></a></td></tr></tbody></table></div>
|
|
3582
|
-
<h4 id="returns-
|
|
3583
|
-
<p><code>ChainWriteBatch</code></p>
|
|
3584
|
-
<h2 id="references">References</h2>
|
|
3585
|
-
<p><a id="documentdata"></a></p>
|
|
3586
|
-
<h3 id="documentdata">DocumentData</h3>
|
|
3587
|
-
<p>Renames and re-exports <a href="#authstate">AuthState</a></p>
|
|
3588
|
-
<hr>
|
|
3589
|
-
<p><a id="fieldvalue"></a></p>
|
|
3590
|
-
<h3 id="fieldvalue">FieldValue</h3>
|
|
3591
|
-
<p>Renames and re-exports <a href="#authstate">AuthState</a></p>
|
|
3592
|
-
<hr>
|
|
3593
|
-
<p><a id="fieldvaluesentinel"></a></p>
|
|
3594
|
-
<h3 id="fieldvaluesentinel">FieldValueSentinel</h3>
|
|
3595
|
-
<p>Renames and re-exports <a href="#authstate">AuthState</a></p>
|
|
3596
|
-
<hr>
|
|
3597
|
-
<p><a id="lintresult"></a></p>
|
|
3598
|
-
<h3 id="lintresult">LintResult</h3>
|
|
3599
|
-
<p>Renames and re-exports <a href="#authstate">AuthState</a></p>
|
|
3600
|
-
<hr>
|
|
3601
|
-
<p><a id="orderdirection"></a></p>
|
|
3602
|
-
<h3 id="orderdirection">OrderDirection</h3>
|
|
3603
|
-
<p>Renames and re-exports <a href="#authstate">AuthState</a></p>
|
|
3604
|
-
<hr>
|
|
3605
|
-
<p><a id="sandbox"></a></p>
|
|
3606
|
-
<h3 id="sandbox">Sandbox</h3>
|
|
3607
|
-
<p>Renames and re-exports <a href="#authstate">AuthState</a></p>
|
|
3608
|
-
<hr>
|
|
3609
|
-
<p><a id="sandboxcontext"></a></p>
|
|
3610
|
-
<h3 id="sandboxcontext">SandboxContext</h3>
|
|
3611
|
-
<p>Renames and re-exports <a href="#authstate">AuthState</a></p>
|
|
3612
|
-
<hr>
|
|
3613
|
-
<p><a id="sandboxerror"></a></p>
|
|
3614
|
-
<h3 id="sandboxerror">SandboxError</h3>
|
|
3615
|
-
<p>Renames and re-exports <a href="#authstate">AuthState</a></p>
|
|
3616
|
-
<hr>
|
|
3617
|
-
<p><a id="timestamp"></a></p>
|
|
3618
|
-
<h3 id="timestamp">Timestamp</h3>
|
|
3619
|
-
<p>Renames and re-exports <a href="#authstate">AuthState</a></p>
|
|
3620
|
-
<hr>
|
|
3621
|
-
<p><a id="wherefilterop"></a></p>
|
|
3622
|
-
<h3 id="wherefilterop">WhereFilterOp</h3>
|
|
3623
|
-
<p>Renames and re-exports <a href="#authstate">AuthState</a></p> </article> </main> <aside class="doc-toc api-symbols" aria-label="API symbols"> <h2 class="doc-toc-heading">Symbols</h2> <input class="api-symbol-filter" type="search" placeholder="Filter symbols" aria-label="Filter API symbols" data-api-symbol-filter> <div class="api-symbol-groups" data-api-symbol-groups> <section class="api-symbol-group" data-api-symbol-group> <a class="api-symbol-kind" href="#classes"> Classes </a> <ul> <li data-api-symbol="bytes"> <a href="#bytes">Bytes</a> </li><li data-api-symbol="fieldpath"> <a href="#fieldpath">FieldPath</a> </li><li data-api-symbol="geopoint"> <a href="#geopoint">GeoPoint</a> </li><li data-api-symbol="vectorvalue"> <a href="#vectorvalue">VectorValue</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group> <a class="api-symbol-kind" href="#interfaces"> Interfaces </a> <ul> <li data-api-symbol="aggregatequerysnapshot"> <a href="#aggregatequerysnapshot">AggregateQuerySnapshot</a> </li><li data-api-symbol="collectionreference"> <a href="#collectionreference">CollectionReference</a> </li><li data-api-symbol="documentreference"> <a href="#documentreference">DocumentReference</a> </li><li data-api-symbol="documentsnapshot"> <a href="#documentsnapshot">DocumentSnapshot</a> </li><li data-api-symbol="firestore"> <a href="#firestore">Firestore</a> </li><li data-api-symbol="firestoredataconverter"> <a href="#firestoredataconverter">FirestoreDataConverter</a> </li><li data-api-symbol="firestoredatatooldeps"> <a href="#firestoredatatooldeps">FirestoreDataToolDeps</a> </li><li data-api-symbol="firestoreinspecttooldeps"> <a href="#firestoreinspecttooldeps">FirestoreInspectToolDeps</a> </li><li data-api-symbol="firestoresettings"> <a href="#firestoresettings">FirestoreSettings</a> </li><li data-api-symbol="localcache"> <a href="#localcache">LocalCache</a> </li><li data-api-symbol="memorygarbagecollector"> <a href="#memorygarbagecollector">MemoryGarbageCollector</a> </li><li data-api-symbol="persistencesettings"> <a href="#persistencesettings">PersistenceSettings</a> </li><li data-api-symbol="persistenttabmanager"> <a href="#persistenttabmanager">PersistentTabManager</a> </li><li data-api-symbol="query"> <a href="#query">Query</a> </li><li data-api-symbol="queryconstraint"> <a href="#queryconstraint">QueryConstraint</a> </li><li data-api-symbol="querydocumentsnapshot"> <a href="#querydocumentsnapshot">QueryDocumentSnapshot</a> </li><li data-api-symbol="querysnapshot"> <a href="#querysnapshot">QuerySnapshot</a> </li><li data-api-symbol="setoptions"> <a href="#setoptions">SetOptions</a> </li><li data-api-symbol="snapshotlistenoptions"> <a href="#snapshotlistenoptions">SnapshotListenOptions</a> </li><li data-api-symbol="snapshotobserver"> <a href="#snapshotobserver">SnapshotObserver</a> </li><li data-api-symbol="userauth"> <a href="#userauth">UserAuth</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group> <a class="api-symbol-kind" href="#type-aliases"> Type Aliases </a> <ul> <li data-api-symbol="aggregatefield"> <a href="#aggregatefield">AggregateField</a> </li><li data-api-symbol="aggregatespec"> <a href="#aggregatespec">AggregateSpec</a> </li><li data-api-symbol="appfirestore"> <a href="#appfirestore">AppFirestore</a> </li><li data-api-symbol="as"> <a href="#as">As</a> </li><li data-api-symbol="authstate"> <a href="#authstate">AuthState</a> </li><li data-api-symbol="loglevel"> <a href="#loglevel">LogLevel</a> </li><li data-api-symbol="transaction"> <a href="#transaction">Transaction</a> </li><li data-api-symbol="unsubscribe()"> <a href="#unsubscribe">Unsubscribe()</a> </li><li data-api-symbol="writebatch"> <a href="#writebatch">WriteBatch</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group> <a class="api-symbol-kind" href="#variables"> Variables </a> <ul> <li data-api-symbol="target_symbol"> <a href="#target_symbol">TARGET_SYMBOL</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group> <a class="api-symbol-kind" href="#functions"> Functions </a> <ul> <li data-api-symbol="actingas()"> <a href="#actingas">actingAs()</a> </li><li data-api-symbol="adddoc()"> <a href="#adddoc">addDoc()</a> </li><li data-api-symbol="and()"> <a href="#and">and()</a> </li><li data-api-symbol="arrayremove()"> <a href="#arrayremove">arrayRemove()</a> </li><li data-api-symbol="arrayunion()"> <a href="#arrayunion">arrayUnion()</a> </li><li data-api-symbol="average()"> <a href="#average">average()</a> </li><li data-api-symbol="clearindexeddbpersistence()"> <a href="#clearindexeddbpersistence">clearIndexedDbPersistence()</a> </li><li data-api-symbol="collection()"> <a href="#collection">collection()</a> </li><li data-api-symbol="collectiongroup()"> <a href="#collectiongroup">collectionGroup()</a> </li><li data-api-symbol="connectfirestoreemulator()"> <a href="#connectfirestoreemulator">connectFirestoreEmulator()</a> </li><li data-api-symbol="count()"> <a href="#count">count()</a> </li><li data-api-symbol="createfirestoredatatools()"> <a href="#createfirestoredatatools">createFirestoreDataTools()</a> </li><li data-api-symbol="createfirestoreinspecttools()"> <a href="#createfirestoreinspecttools">createFirestoreInspectTools()</a> </li><li data-api-symbol="deletedoc()"> <a href="#deletedoc">deleteDoc()</a> </li><li data-api-symbol="deletefield()"> <a href="#deletefield">deleteField()</a> </li><li data-api-symbol="disablenetwork()"> <a href="#disablenetwork">disableNetwork()</a> </li><li data-api-symbol="doc()"> <a href="#doc">doc()</a> </li><li data-api-symbol="documentid()"> <a href="#documentid">documentId()</a> </li><li data-api-symbol="enableindexeddbpersistence()"> <a href="#enableindexeddbpersistence">enableIndexedDbPersistence()</a> </li><li data-api-symbol="enablemultitabindexeddbpersistence()"> <a href="#enablemultitabindexeddbpersistence">enableMultiTabIndexedDbPersistence()</a> </li><li data-api-symbol="enablenetwork()"> <a href="#enablenetwork">enableNetwork()</a> </li><li data-api-symbol="endat()"> <a href="#endat">endAt()</a> </li><li data-api-symbol="endbefore()"> <a href="#endbefore">endBefore()</a> </li><li data-api-symbol="getadminfirestore()"> <a href="#getadminfirestore">getAdminFirestore()</a> </li><li data-api-symbol="getaggregatefromserver()"> <a href="#getaggregatefromserver">getAggregateFromServer()</a> </li><li data-api-symbol="getcountfromserver()"> <a href="#getcountfromserver">getCountFromServer()</a> </li><li data-api-symbol="getdoc()"> <a href="#getdoc">getDoc()</a> </li><li data-api-symbol="getdocfromcache()"> <a href="#getdocfromcache">getDocFromCache()</a> </li><li data-api-symbol="getdocfromserver()"> <a href="#getdocfromserver">getDocFromServer()</a> </li><li data-api-symbol="getdocs()"> <a href="#getdocs">getDocs()</a> </li><li data-api-symbol="getdocsfromcache()"> <a href="#getdocsfromcache">getDocsFromCache()</a> </li><li data-api-symbol="getdocsfromserver()"> <a href="#getdocsfromserver">getDocsFromServer()</a> </li><li data-api-symbol="getfirestore()"> <a href="#getfirestore">getFirestore()</a> </li><li data-api-symbol="increment()"> <a href="#increment">increment()</a> </li><li data-api-symbol="initializefirestore()"> <a href="#initializefirestore">initializeFirestore()</a> </li><li data-api-symbol="limit()"> <a href="#limit">limit()</a> </li><li data-api-symbol="limittolast()"> <a href="#limittolast">limitToLast()</a> </li><li data-api-symbol="memoryeagergarbagecollector()"> <a href="#memoryeagergarbagecollector">memoryEagerGarbageCollector()</a> </li><li data-api-symbol="memorylocalcache()"> <a href="#memorylocalcache">memoryLocalCache()</a> </li><li data-api-symbol="memorylrugarbagecollector()"> <a href="#memorylrugarbagecollector">memoryLruGarbageCollector()</a> </li><li data-api-symbol="onsnapshot()"> <a href="#onsnapshot">onSnapshot()</a> </li><li data-api-symbol="onsnapshotsinsync()"> <a href="#onsnapshotsinsync">onSnapshotsInSync()</a> </li><li data-api-symbol="or()"> <a href="#or">or()</a> </li><li data-api-symbol="orderby()"> <a href="#orderby">orderBy()</a> </li><li data-api-symbol="persistentlocalcache()"> <a href="#persistentlocalcache">persistentLocalCache()</a> </li><li data-api-symbol="persistentmultipletabmanager()"> <a href="#persistentmultipletabmanager">persistentMultipleTabManager()</a> </li><li data-api-symbol="persistentsingletabmanager()"> <a href="#persistentsingletabmanager">persistentSingleTabManager()</a> </li><li data-api-symbol="query()"> <a href="#query-1">query()</a> </li><li data-api-symbol="queryequal()"> <a href="#queryequal">queryEqual()</a> </li><li data-api-symbol="refequal()"> <a href="#refequal">refEqual()</a> </li><li data-api-symbol="runtransaction()"> <a href="#runtransaction">runTransaction()</a> </li><li data-api-symbol="servertimestamp()"> <a href="#servertimestamp">serverTimestamp()</a> </li><li data-api-symbol="setdoc()"> <a href="#setdoc">setDoc()</a> </li><li data-api-symbol="setloglevel()"> <a href="#setloglevel">setLogLevel()</a> </li><li data-api-symbol="snapshotequal()"> <a href="#snapshotequal">snapshotEqual()</a> </li><li data-api-symbol="startafter()"> <a href="#startafter">startAfter()</a> </li><li data-api-symbol="startat()"> <a href="#startat">startAt()</a> </li><li data-api-symbol="sum()"> <a href="#sum">sum()</a> </li><li data-api-symbol="terminate()"> <a href="#terminate">terminate()</a> </li><li data-api-symbol="updatedoc()"> <a href="#updatedoc">updateDoc()</a> </li><li data-api-symbol="vector()"> <a href="#vector">vector()</a> </li><li data-api-symbol="waitforpendingwrites()"> <a href="#waitforpendingwrites">waitForPendingWrites()</a> </li><li data-api-symbol="where()"> <a href="#where">where()</a> </li><li data-api-symbol="withconverter()"> <a href="#withconverter">withConverter()</a> </li><li data-api-symbol="writebatch()"> <a href="#writebatch-1">writeBatch()</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group> <a class="api-symbol-kind" href="#references"> References </a> <ul> <li data-api-symbol="documentdata"> <a href="#documentdata">DocumentData</a> </li><li data-api-symbol="fieldvalue"> <a href="#fieldvalue">FieldValue</a> </li><li data-api-symbol="fieldvaluesentinel"> <a href="#fieldvaluesentinel">FieldValueSentinel</a> </li><li data-api-symbol="lintresult"> <a href="#lintresult">LintResult</a> </li><li data-api-symbol="orderdirection"> <a href="#orderdirection">OrderDirection</a> </li><li data-api-symbol="sandbox"> <a href="#sandbox">Sandbox</a> </li><li data-api-symbol="sandboxcontext"> <a href="#sandboxcontext">SandboxContext</a> </li><li data-api-symbol="sandboxerror"> <a href="#sandboxerror">SandboxError</a> </li><li data-api-symbol="timestamp"> <a href="#timestamp">Timestamp</a> </li><li data-api-symbol="wherefilterop"> <a href="#wherefilterop">WhereFilterOp</a> </li> </ul> </section> <p class="api-symbol-empty" data-api-symbol-empty hidden>No matching symbols</p> </div> </aside> </div> <script type="module">const a=document.querySelector("[data-api-symbol-filter]"),d=[...document.querySelectorAll("[data-api-symbol-group]")],n=document.querySelector("[data-api-symbol-empty]");a?.addEventListener("input",()=>{const t=a.value.trim().toLowerCase();let o=0;for(const i of d){let e=0;i.querySelectorAll("[data-api-symbol]").forEach(l=>{const r=!t||(l.dataset.apiSymbol??"").includes(t);l.hidden=!r,r&&e++}),i.hidden=e===0,o+=e}n&&(n.hidden=o>0)});</script> <script type="module">const s=new Map;document.querySelectorAll('.doc-toc a[href^="#"]').forEach(t=>s.set(decodeURIComponent(t.hash.slice(1)),t));if(s.size>0){const t=new Set,n=()=>{let o=null;for(const e of s.keys())if(t.has(e)){o=e;break}s.forEach((e,c)=>e.classList.toggle("active",c===o))},r=new IntersectionObserver(o=>{for(const e of o)e.isIntersecting?t.add(e.target.id):t.delete(e.target.id);n()},{rootMargin:"-72px 0px -60% 0px"});s.forEach((o,e)=>{const c=document.getElementById(e);c&&r.observe(c)})}</script> <script type="module">document.querySelector('.studio__nav [aria-current="page"]')?.scrollIntoView({block:"nearest",inline:"center"});</script> </body> </html>
|
|
4589
|
+
<h4 id="returns-148">Returns</h4>
|
|
4590
|
+
<p><a href="/docs/pyric-admin-firestore-reference-api/#writebatch"><code>WriteBatch</code></a></p> </article> </main> <aside class="doc-toc api-symbols" aria-label="API symbols"> <h2 class="doc-toc-heading">Symbols</h2> <input class="api-symbol-filter" type="search" placeholder="Filter symbols" aria-label="Filter API symbols" data-api-symbol-filter> <div class="api-symbol-groups" data-api-symbol-groups> <section class="api-symbol-group" data-api-symbol-group> <a class="api-symbol-kind" href="#classes"> Classes </a> <ul> <li data-api-symbol="bytes"> <a href="#bytes">Bytes</a> </li><li data-api-symbol="fieldpath"> <a href="#fieldpath">FieldPath</a> </li><li data-api-symbol="fieldvalue"> <a href="#fieldvalue">FieldValue</a> </li><li data-api-symbol="geopoint"> <a href="#geopoint">GeoPoint</a> </li><li data-api-symbol="sandboxerror"> <a href="#sandboxerror">SandboxError</a> </li><li data-api-symbol="timestamp"> <a href="#timestamp">Timestamp</a> </li><li data-api-symbol="vectorvalue"> <a href="#vectorvalue">VectorValue</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group> <a class="api-symbol-kind" href="#interfaces"> Interfaces </a> <ul> <li data-api-symbol="aggregatequerysnapshot"> <a href="#aggregatequerysnapshot">AggregateQuerySnapshot</a> </li><li data-api-symbol="collectionreference"> <a href="#collectionreference">CollectionReference</a> </li><li data-api-symbol="documentreference"> <a href="#documentreference">DocumentReference</a> </li><li data-api-symbol="documentsnapshot"> <a href="#documentsnapshot">DocumentSnapshot</a> </li><li data-api-symbol="firestore"> <a href="#firestore">Firestore</a> </li><li data-api-symbol="firestoredataconverter"> <a href="#firestoredataconverter">FirestoreDataConverter</a> </li><li data-api-symbol="firestoredatatooldeps"> <a href="#firestoredatatooldeps">FirestoreDataToolDeps</a> </li><li data-api-symbol="firestoreinspecttooldeps"> <a href="#firestoreinspecttooldeps">FirestoreInspectToolDeps</a> </li><li data-api-symbol="firestoresettings"> <a href="#firestoresettings">FirestoreSettings</a> </li><li data-api-symbol="lintresult"> <a href="#lintresult">LintResult</a> </li><li data-api-symbol="localcache"> <a href="#localcache">LocalCache</a> </li><li data-api-symbol="memorygarbagecollector"> <a href="#memorygarbagecollector">MemoryGarbageCollector</a> </li><li data-api-symbol="persistencesettings"> <a href="#persistencesettings">PersistenceSettings</a> </li><li data-api-symbol="persistenttabmanager"> <a href="#persistenttabmanager">PersistentTabManager</a> </li><li data-api-symbol="query"> <a href="#query">Query</a> </li><li data-api-symbol="queryconstraint"> <a href="#queryconstraint">QueryConstraint</a> </li><li data-api-symbol="querydocumentsnapshot"> <a href="#querydocumentsnapshot">QueryDocumentSnapshot</a> </li><li data-api-symbol="querysnapshot"> <a href="#querysnapshot">QuerySnapshot</a> </li><li data-api-symbol="sandbox"> <a href="#sandbox">Sandbox</a> </li><li data-api-symbol="sandboxcontext"> <a href="#sandboxcontext">SandboxContext</a> </li><li data-api-symbol="setoptions"> <a href="#setoptions">SetOptions</a> </li><li data-api-symbol="snapshotlistenoptions"> <a href="#snapshotlistenoptions">SnapshotListenOptions</a> </li><li data-api-symbol="snapshotobserver"> <a href="#snapshotobserver">SnapshotObserver</a> </li><li data-api-symbol="userauth"> <a href="#userauth">UserAuth</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group> <a class="api-symbol-kind" href="#type-aliases"> Type Aliases </a> <ul> <li data-api-symbol="aggregatefield"> <a href="#aggregatefield">AggregateField</a> </li><li data-api-symbol="aggregatespec"> <a href="#aggregatespec">AggregateSpec</a> </li><li data-api-symbol="appfirestore"> <a href="#appfirestore">AppFirestore</a> </li><li data-api-symbol="as"> <a href="#as">As</a> </li><li data-api-symbol="authstate"> <a href="#authstate">AuthState</a> </li><li data-api-symbol="documentdata"> <a href="#documentdata">DocumentData</a> </li><li data-api-symbol="fieldvaluesentinel"> <a href="#fieldvaluesentinel">FieldValueSentinel</a> </li><li data-api-symbol="loglevel"> <a href="#loglevel">LogLevel</a> </li><li data-api-symbol="orderdirection"> <a href="#orderdirection">OrderDirection</a> </li><li data-api-symbol="transaction"> <a href="#transaction">Transaction</a> </li><li data-api-symbol="unsubscribe()"> <a href="#unsubscribe">Unsubscribe()</a> </li><li data-api-symbol="wherefilterop"> <a href="#wherefilterop">WhereFilterOp</a> </li><li data-api-symbol="writebatch"> <a href="#writebatch">WriteBatch</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group> <a class="api-symbol-kind" href="#variables"> Variables </a> <ul> <li data-api-symbol="target_symbol"> <a href="#target_symbol">TARGET_SYMBOL</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group> <a class="api-symbol-kind" href="#functions"> Functions </a> <ul> <li data-api-symbol="actingas()"> <a href="#actingas">actingAs()</a> </li><li data-api-symbol="adddoc()"> <a href="#adddoc">addDoc()</a> </li><li data-api-symbol="and()"> <a href="#and">and()</a> </li><li data-api-symbol="arrayremove()"> <a href="#arrayremove-1">arrayRemove()</a> </li><li data-api-symbol="arrayunion()"> <a href="#arrayunion-1">arrayUnion()</a> </li><li data-api-symbol="average()"> <a href="#average">average()</a> </li><li data-api-symbol="clearindexeddbpersistence()"> <a href="#clearindexeddbpersistence">clearIndexedDbPersistence()</a> </li><li data-api-symbol="collection()"> <a href="#collection">collection()</a> </li><li data-api-symbol="collectiongroup()"> <a href="#collectiongroup">collectionGroup()</a> </li><li data-api-symbol="connectfirestoreemulator()"> <a href="#connectfirestoreemulator">connectFirestoreEmulator()</a> </li><li data-api-symbol="count()"> <a href="#count">count()</a> </li><li data-api-symbol="createfirestoredatatools()"> <a href="#createfirestoredatatools">createFirestoreDataTools()</a> </li><li data-api-symbol="createfirestoreinspecttools()"> <a href="#createfirestoreinspecttools">createFirestoreInspectTools()</a> </li><li data-api-symbol="deletedoc()"> <a href="#deletedoc">deleteDoc()</a> </li><li data-api-symbol="deletefield()"> <a href="#deletefield">deleteField()</a> </li><li data-api-symbol="disablenetwork()"> <a href="#disablenetwork">disableNetwork()</a> </li><li data-api-symbol="doc()"> <a href="#doc">doc()</a> </li><li data-api-symbol="documentid()"> <a href="#documentid">documentId()</a> </li><li data-api-symbol="enableindexeddbpersistence()"> <a href="#enableindexeddbpersistence">enableIndexedDbPersistence()</a> </li><li data-api-symbol="enablemultitabindexeddbpersistence()"> <a href="#enablemultitabindexeddbpersistence">enableMultiTabIndexedDbPersistence()</a> </li><li data-api-symbol="enablenetwork()"> <a href="#enablenetwork">enableNetwork()</a> </li><li data-api-symbol="endat()"> <a href="#endat">endAt()</a> </li><li data-api-symbol="endbefore()"> <a href="#endbefore">endBefore()</a> </li><li data-api-symbol="getadminfirestore()"> <a href="#getadminfirestore">getAdminFirestore()</a> </li><li data-api-symbol="getaggregatefromserver()"> <a href="#getaggregatefromserver">getAggregateFromServer()</a> </li><li data-api-symbol="getcountfromserver()"> <a href="#getcountfromserver">getCountFromServer()</a> </li><li data-api-symbol="getdoc()"> <a href="#getdoc">getDoc()</a> </li><li data-api-symbol="getdocfromcache()"> <a href="#getdocfromcache">getDocFromCache()</a> </li><li data-api-symbol="getdocfromserver()"> <a href="#getdocfromserver">getDocFromServer()</a> </li><li data-api-symbol="getdocs()"> <a href="#getdocs">getDocs()</a> </li><li data-api-symbol="getdocsfromcache()"> <a href="#getdocsfromcache">getDocsFromCache()</a> </li><li data-api-symbol="getdocsfromserver()"> <a href="#getdocsfromserver">getDocsFromServer()</a> </li><li data-api-symbol="getfirestore()"> <a href="#getfirestore">getFirestore()</a> </li><li data-api-symbol="increment()"> <a href="#increment-1">increment()</a> </li><li data-api-symbol="initializefirestore()"> <a href="#initializefirestore">initializeFirestore()</a> </li><li data-api-symbol="limit()"> <a href="#limit">limit()</a> </li><li data-api-symbol="limittolast()"> <a href="#limittolast">limitToLast()</a> </li><li data-api-symbol="memoryeagergarbagecollector()"> <a href="#memoryeagergarbagecollector">memoryEagerGarbageCollector()</a> </li><li data-api-symbol="memorylocalcache()"> <a href="#memorylocalcache">memoryLocalCache()</a> </li><li data-api-symbol="memorylrugarbagecollector()"> <a href="#memorylrugarbagecollector">memoryLruGarbageCollector()</a> </li><li data-api-symbol="onsnapshot()"> <a href="#onsnapshot">onSnapshot()</a> </li><li data-api-symbol="onsnapshotsinsync()"> <a href="#onsnapshotsinsync">onSnapshotsInSync()</a> </li><li data-api-symbol="or()"> <a href="#or">or()</a> </li><li data-api-symbol="orderby()"> <a href="#orderby">orderBy()</a> </li><li data-api-symbol="persistentlocalcache()"> <a href="#persistentlocalcache">persistentLocalCache()</a> </li><li data-api-symbol="persistentmultipletabmanager()"> <a href="#persistentmultipletabmanager">persistentMultipleTabManager()</a> </li><li data-api-symbol="persistentsingletabmanager()"> <a href="#persistentsingletabmanager">persistentSingleTabManager()</a> </li><li data-api-symbol="query()"> <a href="#query-1">query()</a> </li><li data-api-symbol="queryequal()"> <a href="#queryequal">queryEqual()</a> </li><li data-api-symbol="refequal()"> <a href="#refequal">refEqual()</a> </li><li data-api-symbol="runtransaction()"> <a href="#runtransaction">runTransaction()</a> </li><li data-api-symbol="servertimestamp()"> <a href="#servertimestamp-1">serverTimestamp()</a> </li><li data-api-symbol="setdoc()"> <a href="#setdoc">setDoc()</a> </li><li data-api-symbol="setloglevel()"> <a href="#setloglevel">setLogLevel()</a> </li><li data-api-symbol="snapshotequal()"> <a href="#snapshotequal">snapshotEqual()</a> </li><li data-api-symbol="startafter()"> <a href="#startafter">startAfter()</a> </li><li data-api-symbol="startat()"> <a href="#startat">startAt()</a> </li><li data-api-symbol="sum()"> <a href="#sum">sum()</a> </li><li data-api-symbol="terminate()"> <a href="#terminate">terminate()</a> </li><li data-api-symbol="updatedoc()"> <a href="#updatedoc">updateDoc()</a> </li><li data-api-symbol="vector()"> <a href="#vector">vector()</a> </li><li data-api-symbol="waitforpendingwrites()"> <a href="#waitforpendingwrites">waitForPendingWrites()</a> </li><li data-api-symbol="where()"> <a href="#where">where()</a> </li><li data-api-symbol="withconverter()"> <a href="#withconverter">withConverter()</a> </li><li data-api-symbol="writebatch()"> <a href="#writebatch-1">writeBatch()</a> </li> </ul> </section> <p class="api-symbol-empty" data-api-symbol-empty hidden>No matching symbols</p> </div> </aside> </div> <script type="module">const a=document.querySelector("[data-api-symbol-filter]"),d=[...document.querySelectorAll("[data-api-symbol-group]")],n=document.querySelector("[data-api-symbol-empty]");a?.addEventListener("input",()=>{const t=a.value.trim().toLowerCase();let o=0;for(const i of d){let e=0;i.querySelectorAll("[data-api-symbol]").forEach(l=>{const r=!t||(l.dataset.apiSymbol??"").includes(t);l.hidden=!r,r&&e++}),i.hidden=e===0,o+=e}n&&(n.hidden=o>0)});</script> <script type="module">const s=new Map;document.querySelectorAll('.doc-toc a[href^="#"]').forEach(t=>s.set(decodeURIComponent(t.hash.slice(1)),t));if(s.size>0){const t=new Set,n=()=>{let o=null;for(const e of s.keys())if(t.has(e)){o=e;break}s.forEach((e,c)=>e.classList.toggle("active",c===o))},r=new IntersectionObserver(o=>{for(const e of o)e.isIntersecting?t.add(e.target.id):t.delete(e.target.id);n()},{rootMargin:"-72px 0px -60% 0px"});s.forEach((o,e)=>{const c=document.getElementById(e);c&&r.observe(c)})}</script> <script type="module">document.querySelector('.studio__nav [aria-current="page"]')?.scrollIntoView({block:"nearest",inline:"center"});</script> </body> </html>
|