@pyric/cli 0.1.0-alpha.13 → 0.1.0-alpha.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (614) hide show
  1. package/dist/assurance/.generated/conformance-verdicts.d.ts +120 -75
  2. package/dist/assurance/.generated/conformance-verdicts.d.ts.map +1 -1
  3. package/dist/assurance/.generated/conformance-verdicts.js +120 -75
  4. package/dist/assurance/.generated/conformance-verdicts.js.map +1 -1
  5. package/dist/cli/serve.d.ts +1 -1
  6. package/dist/cli/serve.d.ts.map +1 -1
  7. package/dist/cli/serve.js +208 -285
  8. package/dist/cli/serve.js.map +1 -1
  9. package/dist/cli/service-command-records/database-rules-generate.d.ts +4 -0
  10. package/dist/cli/service-command-records/database-rules-generate.d.ts.map +1 -0
  11. package/dist/cli/service-command-records/database-rules-generate.js +3 -0
  12. package/dist/cli/service-command-records/database-rules-generate.js.map +1 -0
  13. package/dist/cli/service-command-records/database-rules-lint.d.ts +4 -0
  14. package/dist/cli/service-command-records/database-rules-lint.d.ts.map +1 -0
  15. package/dist/cli/service-command-records/database-rules-lint.js +3 -0
  16. package/dist/cli/service-command-records/database-rules-lint.js.map +1 -0
  17. package/dist/cli/service-command-records/database-rules-simulate.d.ts +4 -0
  18. package/dist/cli/service-command-records/database-rules-simulate.d.ts.map +1 -0
  19. package/dist/cli/service-command-records/database-rules-simulate.js +3 -0
  20. package/dist/cli/service-command-records/database-rules-simulate.js.map +1 -0
  21. package/dist/cli/service-command-records/database-rules-validate.d.ts +4 -0
  22. package/dist/cli/service-command-records/database-rules-validate.d.ts.map +1 -0
  23. package/dist/cli/service-command-records/database-rules-validate.js +3 -0
  24. package/dist/cli/service-command-records/database-rules-validate.js.map +1 -0
  25. package/dist/cli/service-command-records/firestore-indexes-generate.d.ts +4 -0
  26. package/dist/cli/service-command-records/firestore-indexes-generate.d.ts.map +1 -0
  27. package/dist/cli/service-command-records/firestore-indexes-generate.js +3 -0
  28. package/dist/cli/service-command-records/firestore-indexes-generate.js.map +1 -0
  29. package/dist/cli/service-command-records/firestore-rules-lint.d.ts +4 -0
  30. package/dist/cli/service-command-records/firestore-rules-lint.d.ts.map +1 -0
  31. package/dist/cli/service-command-records/firestore-rules-lint.js +3 -0
  32. package/dist/cli/service-command-records/firestore-rules-lint.js.map +1 -0
  33. package/dist/cli/service-command-records/firestore-rules-resolve.d.ts +4 -0
  34. package/dist/cli/service-command-records/firestore-rules-resolve.d.ts.map +1 -0
  35. package/dist/cli/service-command-records/firestore-rules-resolve.js +3 -0
  36. package/dist/cli/service-command-records/firestore-rules-resolve.js.map +1 -0
  37. package/dist/cli/service-command-records/firestore-rules-simulate.d.ts +4 -0
  38. package/dist/cli/service-command-records/firestore-rules-simulate.d.ts.map +1 -0
  39. package/dist/cli/service-command-records/firestore-rules-simulate.js +3 -0
  40. package/dist/cli/service-command-records/firestore-rules-simulate.js.map +1 -0
  41. package/dist/cli/service-command-records/firestore-rules-validate.d.ts +4 -0
  42. package/dist/cli/service-command-records/firestore-rules-validate.d.ts.map +1 -0
  43. package/dist/cli/service-command-records/firestore-rules-validate.js +3 -0
  44. package/dist/cli/service-command-records/firestore-rules-validate.js.map +1 -0
  45. package/dist/cli/service-command-records/storage-rules-lint.d.ts +4 -0
  46. package/dist/cli/service-command-records/storage-rules-lint.d.ts.map +1 -0
  47. package/dist/cli/service-command-records/storage-rules-lint.js +3 -0
  48. package/dist/cli/service-command-records/storage-rules-lint.js.map +1 -0
  49. package/dist/cli/service-command-records/storage-rules-simulate.d.ts +4 -0
  50. package/dist/cli/service-command-records/storage-rules-simulate.d.ts.map +1 -0
  51. package/dist/cli/service-command-records/storage-rules-simulate.js +3 -0
  52. package/dist/cli/service-command-records/storage-rules-simulate.js.map +1 -0
  53. package/dist/cli/service-commands.d.ts +7 -0
  54. package/dist/cli/service-commands.d.ts.map +1 -1
  55. package/dist/cli/service-commands.generated.d.ts +35 -0
  56. package/dist/cli/service-commands.generated.d.ts.map +1 -0
  57. package/dist/cli/service-commands.generated.js +25 -0
  58. package/dist/cli/service-commands.generated.js.map +1 -0
  59. package/dist/cli/service-commands.js +23 -40
  60. package/dist/cli/service-commands.js.map +1 -1
  61. package/dist/conformance/.generated/can-i-use-browser.d.ts.map +1 -1
  62. package/dist/conformance/.generated/can-i-use-browser.js +1 -1
  63. package/dist/conformance/.generated/can-i-use-browser.js.map +1 -1
  64. package/dist/conformance/.generated/can-i-use.d.ts.map +1 -1
  65. package/dist/conformance/.generated/can-i-use.js +1 -1
  66. package/dist/conformance/.generated/can-i-use.js.map +1 -1
  67. package/dist/conformance/.generated/conformance-docs.d.ts.map +1 -1
  68. package/dist/conformance/.generated/conformance-docs.js +1 -1
  69. package/dist/conformance/.generated/conformance-docs.js.map +1 -1
  70. package/dist/functions-rtdb/development-runtime.d.ts +63 -0
  71. package/dist/functions-rtdb/development-runtime.d.ts.map +1 -0
  72. package/dist/functions-rtdb/development-runtime.js +244 -0
  73. package/dist/functions-rtdb/development-runtime.js.map +1 -0
  74. package/dist/serve/bridge-mount.d.ts +32 -2
  75. package/dist/serve/bridge-mount.d.ts.map +1 -1
  76. package/dist/serve/bridge-mount.js +232 -18
  77. package/dist/serve/bridge-mount.js.map +1 -1
  78. package/dist/serve/bundler.d.ts +4 -18
  79. package/dist/serve/bundler.d.ts.map +1 -1
  80. package/dist/serve/bundler.js +15 -37
  81. package/dist/serve/bundler.js.map +1 -1
  82. package/dist/serve/entries/app-client.d.ts.map +1 -1
  83. package/dist/serve/entries/app-client.js +5 -5
  84. package/dist/serve/entries/app-client.js.map +1 -1
  85. package/dist/serve/entries/auth-helper-core.d.ts +23 -6
  86. package/dist/serve/entries/auth-helper-core.d.ts.map +1 -1
  87. package/dist/serve/entries/auth-helper-core.js +55 -24
  88. package/dist/serve/entries/auth-helper-core.js.map +1 -1
  89. package/dist/serve/entries/database.d.ts +28 -0
  90. package/dist/serve/entries/database.d.ts.map +1 -1
  91. package/dist/serve/entries/database.js +95 -26
  92. package/dist/serve/entries/database.js.map +1 -1
  93. package/dist/serve/entries/init.d.ts.map +1 -1
  94. package/dist/serve/entries/init.js +21 -12
  95. package/dist/serve/entries/init.js.map +1 -1
  96. package/dist/serve/html-injection.d.ts +5 -0
  97. package/dist/serve/html-injection.d.ts.map +1 -0
  98. package/dist/serve/html-injection.js +59 -0
  99. package/dist/serve/html-injection.js.map +1 -0
  100. package/dist/serve/namespace.d.ts +6 -22
  101. package/dist/serve/namespace.d.ts.map +1 -1
  102. package/dist/serve/namespace.js +23 -145
  103. package/dist/serve/namespace.js.map +1 -1
  104. package/dist/serve/runtime/worker-generation.d.ts +10 -2
  105. package/dist/serve/runtime/worker-generation.d.ts.map +1 -1
  106. package/dist/serve/runtime/worker-generation.js +29 -8
  107. package/dist/serve/runtime/worker-generation.js.map +1 -1
  108. package/dist/serve/runtime/worker-replacement.d.ts +1 -2
  109. package/dist/serve/runtime/worker-replacement.d.ts.map +1 -1
  110. package/dist/serve/sandbox-session.d.ts +78 -0
  111. package/dist/serve/sandbox-session.d.ts.map +1 -0
  112. package/dist/serve/sandbox-session.js +171 -0
  113. package/dist/serve/sandbox-session.js.map +1 -0
  114. package/dist/serve/server.d.ts +5 -2
  115. package/dist/serve/server.d.ts.map +1 -1
  116. package/dist/serve/server.js +21 -5
  117. package/dist/serve/server.js.map +1 -1
  118. package/dist/serve/site-tree.d.ts +8 -0
  119. package/dist/serve/site-tree.d.ts.map +1 -0
  120. package/dist/serve/site-tree.js +113 -0
  121. package/dist/serve/site-tree.js.map +1 -0
  122. package/dist/serve/site-ui/_astro/RulesCodeEditor.CzwHdCi9.js +23 -0
  123. package/dist/serve/site-ui/_astro/_example_.jevZ7OdV.css +1 -0
  124. package/dist/serve/site-ui/_astro/_slug_.BoKXYrnu.css +1 -0
  125. package/dist/serve/site-ui/_astro/_studio_.BtYpqe1A.css +1 -0
  126. package/dist/serve/site-ui/_astro/app.BnMC0ywl.js +109 -0
  127. package/dist/serve/site-ui/_astro/app.BsFsMjn0.css +1 -0
  128. package/dist/serve/site-ui/_astro/app.DVXXR-WI.js +1 -0
  129. package/dist/serve/site-ui/_astro/chess-showcase.DzPO6kz0.js +1 -0
  130. package/dist/serve/site-ui/_astro/chess-source-explorer.C5k9c5yK.js +1 -0
  131. package/dist/serve/site-ui/_astro/chess-v2.CFHmd3UL.js +354 -0
  132. package/dist/serve/site-ui/_astro/client.D2ORs4B-.js +25 -0
  133. package/dist/serve/site-ui/_astro/example-runtime.CM0H02rx.js +291 -0
  134. package/dist/serve/site-ui/_astro/index.B4Kh80he.js +1 -0
  135. package/dist/serve/site-ui/_astro/index.DBy5LfQW.js +9 -0
  136. package/dist/serve/site-ui/_astro/index.DNyk7q8W.js +9 -0
  137. package/dist/serve/site-ui/_astro/jsx-runtime.D_zvdyIk.js +9 -0
  138. package/dist/serve/site-ui/_astro/reads.D1exkX1-.js +1 -0
  139. package/dist/serve/site-ui/_astro/sandbox-controls.BqMePr5V.js +1153 -0
  140. package/dist/serve/site-ui/_astro/seed.BCn5DhHS.js +20 -0
  141. package/dist/serve/site-ui/auth/index.html +11 -0
  142. package/dist/serve/site-ui/docs/_rhythm/index.html +100 -0
  143. package/dist/serve/site-ui/docs/agent/set-up-your-agent/index.html +43 -0
  144. package/dist/serve/site-ui/docs/agent/watch-and-review/index.html +26 -0
  145. package/dist/serve/site-ui/docs/agent/work-with-an-agent/index.html +70 -0
  146. package/dist/serve/{docs-ui → site-ui}/docs/ai-compat/index.html +3 -3
  147. package/dist/serve/site-ui/docs/api-reference/index.html +68 -0
  148. package/dist/serve/{docs-ui → site-ui}/docs/app-compat/index.html +3 -3
  149. package/dist/serve/{docs-ui → site-ui}/docs/auth-compat/index.html +3 -3
  150. package/dist/serve/site-ui/docs/build/ai-logic/index.html +64 -0
  151. package/dist/serve/site-ui/docs/build/authentication/index.html +66 -0
  152. package/dist/serve/site-ui/docs/build/cloud-firestore/index.html +84 -0
  153. package/dist/serve/site-ui/docs/build/cloud-messaging/index.html +71 -0
  154. package/dist/serve/site-ui/docs/build/cloud-storage/index.html +66 -0
  155. package/dist/serve/{docs-ui → site-ui}/docs/build/cloud-storage.md +2 -2
  156. package/dist/serve/site-ui/docs/build/realtime-database/index.html +67 -0
  157. package/dist/serve/site-ui/docs/conformance-scores/index.html +50 -0
  158. package/dist/serve/{docs-ui → site-ui}/docs/conformance-scores.md +3 -3
  159. package/dist/serve/site-ui/docs/create-pyric-reference-api/index.html +531 -0
  160. package/dist/serve/{docs-ui → site-ui}/docs/database-compat/index.html +211 -168
  161. package/dist/serve/{docs-ui → site-ui}/docs/database-compat.md +208 -170
  162. package/dist/serve/site-ui/docs/examples/chess/index.html +384 -0
  163. package/dist/serve/site-ui/docs/examples/chess.md +57 -0
  164. package/dist/serve/site-ui/docs/examples/index.html +3 -0
  165. package/dist/serve/site-ui/docs/examples.md +4 -0
  166. package/dist/serve/{docs-ui → site-ui}/docs/firestore-compat/index.html +55 -91
  167. package/dist/serve/{docs-ui → site-ui}/docs/firestore-compat.md +52 -88
  168. package/dist/serve/site-ui/docs/functions-rtdb-compat/index.html +73 -0
  169. package/dist/serve/site-ui/docs/get-started/how-the-swap-works/index.html +29 -0
  170. package/dist/serve/site-ui/docs/get-started/start-building/index.html +33 -0
  171. package/dist/serve/{docs-ui → site-ui}/docs/index.json +595 -26
  172. package/dist/serve/site-ui/docs/messaging-compat/index.html +324 -0
  173. package/dist/serve/{docs-ui → site-ui}/docs/messaging-compat.md +71 -1
  174. package/dist/serve/site-ui/docs/observe/resolve-runtime-status/index.html +28 -0
  175. package/dist/serve/site-ui/docs/observe/see-whats-happening/index.html +74 -0
  176. package/dist/serve/site-ui/docs/observe/shape-your-data/index.html +45 -0
  177. package/dist/serve/site-ui/docs/overview/index.html +17 -0
  178. package/dist/serve/site-ui/docs/pyric-admin-app-reference-api/index.html +186 -0
  179. package/dist/serve/{docs-ui → site-ui}/docs/pyric-admin-auth-reference-api/index.html +4 -4
  180. package/dist/serve/{docs-ui → site-ui}/docs/pyric-admin-database-reference-api/index.html +4 -4
  181. package/dist/serve/{docs-ui → site-ui}/docs/pyric-admin-firestore-reference-api/index.html +318 -202
  182. package/dist/serve/{docs-ui → site-ui}/docs/pyric-admin-firestore-reference-api.md +154 -27
  183. package/dist/serve/{docs-ui → site-ui}/docs/pyric-admin-messaging-reference-api/index.html +5 -5
  184. package/dist/serve/site-ui/docs/pyric-admin-storage-reference-api/index.html +318 -0
  185. package/dist/serve/{docs-ui → site-ui}/docs/pyric-ai-reference-api/index.html +5 -5
  186. package/dist/serve/site-ui/docs/pyric-ai-scripting-reference-api/index.html +160 -0
  187. package/dist/serve/site-ui/docs/pyric-app-reference-api/index.html +425 -0
  188. package/dist/serve/{docs-ui → site-ui}/docs/pyric-auth-reference-api/index.html +5 -5
  189. package/dist/serve/site-ui/docs/pyric-cli-assurance-browser-reference-api/index.html +60 -0
  190. package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-assurance-reference-api/index.html +4 -4
  191. package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-bridge-client-reference-api/index.html +4 -4
  192. package/dist/serve/site-ui/docs/pyric-cli-bridge-reference-api/index.html +507 -0
  193. package/dist/serve/site-ui/docs/pyric-cli-conformance-browser-reference-api/index.html +258 -0
  194. package/dist/serve/site-ui/docs/pyric-cli-conformance-docs-reference-api/index.html +51 -0
  195. package/dist/serve/site-ui/docs/pyric-cli-conformance-reference-api/index.html +308 -0
  196. package/dist/serve/site-ui/docs/pyric-cli-credentials-node-reference-api/index.html +68 -0
  197. package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-discover-reference-api/index.html +4 -4
  198. package/dist/serve/site-ui/docs/pyric-cli-register-reference-api/index.html +11 -0
  199. package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-remote-reference-api/index.html +4 -4
  200. package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-serve-worker-reference-api/index.html +1186 -1384
  201. package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-serve-worker-reference-api.md +817 -1291
  202. package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-verify-reference-api/index.html +4 -4
  203. package/dist/serve/site-ui/docs/pyric-cli-vite-reference-api/index.html +126 -0
  204. package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-vite-reference-api.md +1 -1
  205. package/dist/serve/site-ui/docs/pyric-database-reference-api/index.html +2641 -0
  206. package/dist/serve/{docs-ui → site-ui}/docs/pyric-database-reference-api.md +1055 -158
  207. package/dist/serve/{docs-ui → site-ui}/docs/pyric-firestore-reference-api/index.html +311 -249
  208. package/dist/serve/{docs-ui → site-ui}/docs/pyric-firestore-reference-api.md +72 -54
  209. package/dist/serve/site-ui/docs/pyric-messaging-reference-api/index.html +509 -0
  210. package/dist/serve/site-ui/docs/pyric-messaging-sw-reference-api/index.html +182 -0
  211. package/dist/serve/{docs-ui → site-ui}/docs/pyric-rules-reference-api/index.html +7 -26
  212. package/dist/serve/{docs-ui → site-ui}/docs/pyric-rules-reference-api.md +13 -23
  213. package/dist/serve/site-ui/docs/pyric-sandbox-database-reference-api/index.html +121 -0
  214. package/dist/serve/site-ui/docs/pyric-sandbox-firestore-reference-api/index.html +203 -0
  215. package/dist/serve/{docs-ui → site-ui}/docs/pyric-sandbox-reference-api/index.html +26 -5
  216. package/dist/serve/{docs-ui → site-ui}/docs/pyric-sandbox-reference-api.md +22 -22
  217. package/dist/serve/{docs-ui → site-ui}/docs/pyric-storage-reference-api/index.html +5 -15
  218. package/dist/serve/{docs-ui → site-ui}/docs/pyric-storage-reference-api.md +0 -13
  219. package/dist/serve/site-ui/docs/pyric-ui-agents-reference-api/index.html +639 -0
  220. package/dist/serve/site-ui/docs/pyric-ui-auth-hooks-reference-api/index.html +100 -0
  221. package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-auth-reference-api/index.html +4 -4
  222. package/dist/serve/site-ui/docs/pyric-ui-events-hooks-reference-api/index.html +24 -0
  223. package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-events-reference-api/index.html +4 -4
  224. package/dist/serve/site-ui/docs/pyric-ui-firestore-hooks-reference-api/index.html +136 -0
  225. package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-firestore-reference-api/index.html +7 -7
  226. package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-firestore-reference-api.md +4 -4
  227. package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-primitives-reference-api/index.html +4 -4
  228. package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-rtdb-reference-api/index.html +4 -4
  229. package/dist/serve/site-ui/docs/pyric-ui-rules-hooks-reference-api/index.html +16 -0
  230. package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-rules-reference-api/index.html +4 -4
  231. package/dist/serve/site-ui/docs/pyric-ui-storage-hooks-reference-api/index.html +176 -0
  232. package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-storage-reference-api/index.html +10 -11
  233. package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-storage-reference-api.md +7 -8
  234. package/dist/serve/site-ui/docs/pyric-ui-traffic-hooks-reference-api/index.html +188 -0
  235. package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-traffic-reference-api/index.html +4 -4
  236. package/dist/serve/{docs-ui → site-ui}/docs/rules-compat/index.html +87 -57
  237. package/dist/serve/{docs-ui → site-ui}/docs/rules-compat.md +84 -54
  238. package/dist/serve/site-ui/docs/secure/audit-your-rules/index.html +51 -0
  239. package/dist/serve/site-ui/docs/secure/firestore-rules-limits/index.html +106 -0
  240. package/dist/serve/site-ui/docs/secure/read-a-denial/index.html +41 -0
  241. package/dist/serve/site-ui/docs/secure/rtdb-rules-in-typescript/index.html +67 -0
  242. package/dist/serve/site-ui/docs/secure/rules-standard-library/index.html +159 -0
  243. package/dist/serve/{docs-ui → site-ui}/docs/secure/rules-standard-library.md +2 -2
  244. package/dist/serve/site-ui/docs/secure/secure-it-with-rules/index.html +47 -0
  245. package/dist/serve/site-ui/docs/secure/simulate-and-lint/index.html +95 -0
  246. package/dist/serve/site-ui/docs/secure/write-a-rules-test-suite/index.html +82 -0
  247. package/dist/serve/site-ui/docs/ship/ship-to-production/index.html +37 -0
  248. package/dist/serve/site-ui/docs/ship/test-in-node/index.html +75 -0
  249. package/dist/serve/{docs-ui → site-ui}/docs/storage-compat/index.html +8 -8
  250. package/dist/serve/{docs-ui → site-ui}/docs/storage-compat.md +5 -5
  251. package/dist/serve/site-ui/docs/trust/how-we-know-it-matches-firebase/index.html +132 -0
  252. package/dist/serve/site-ui/docs/trust/rules-standard-library/index.html +861 -0
  253. package/dist/serve/site-ui/docs/trust/rules-standard-library.md +344 -0
  254. package/dist/serve/site-ui/docs/trust/storage-rules-stdlib-research/index.html +582 -0
  255. package/dist/serve/site-ui/docs/trust/storage-rules-stdlib-research.md +448 -0
  256. package/dist/serve/site-ui/docs/trust/versioning-and-compatibility/index.html +14 -0
  257. package/dist/serve/{docs-ui → site-ui}/docs/tutorial/index.html +4 -4
  258. package/dist/serve/{docs-ui → site-ui}/docs/tutorial.md +1 -1
  259. package/dist/serve/site-ui/examples/chess/index.html +2 -0
  260. package/dist/serve/site-ui/examples/firestore-first-write/index.html +2 -0
  261. package/dist/serve/site-ui/firestore/index.html +11 -0
  262. package/dist/serve/site-ui/index.html +11 -0
  263. package/dist/serve/{docs-ui → site-ui}/llms.txt +6 -2
  264. package/dist/serve/site-ui/rtdb/index.html +11 -0
  265. package/dist/serve/site-ui/settings/index.html +11 -0
  266. package/dist/serve/site-ui/storage/index.html +11 -0
  267. package/dist/serve/site-ui/studio-routes.json +1 -0
  268. package/dist/serve/site-ui/traffic/index.html +11 -0
  269. package/dist/serve/standalone-assets.d.ts +4 -10
  270. package/dist/serve/standalone-assets.d.ts.map +1 -1
  271. package/dist/serve/standalone-assets.js +8 -21
  272. package/dist/serve/standalone-assets.js.map +1 -1
  273. package/dist/serve/vite-ai-config.d.ts +2 -0
  274. package/dist/serve/vite-ai-config.d.ts.map +1 -1
  275. package/dist/serve/vite-ai-config.js +4 -0
  276. package/dist/serve/vite-ai-config.js.map +1 -1
  277. package/dist/serve/vite-functions-development.d.ts +29 -0
  278. package/dist/serve/vite-functions-development.d.ts.map +1 -0
  279. package/dist/serve/vite-functions-development.js +150 -0
  280. package/dist/serve/vite-functions-development.js.map +1 -0
  281. package/dist/serve/vite-generation-bridge.d.ts +17 -0
  282. package/dist/serve/vite-generation-bridge.d.ts.map +1 -0
  283. package/dist/serve/vite-generation-bridge.js +47 -0
  284. package/dist/serve/vite-generation-bridge.js.map +1 -0
  285. package/dist/serve/vite-generation-functions.d.ts +35 -0
  286. package/dist/serve/vite-generation-functions.d.ts.map +1 -0
  287. package/dist/serve/vite-generation-functions.js +46 -0
  288. package/dist/serve/vite-generation-functions.js.map +1 -0
  289. package/dist/serve/vite-generation-middleware.d.ts +10 -0
  290. package/dist/serve/vite-generation-middleware.d.ts.map +1 -0
  291. package/dist/serve/vite-generation-middleware.js +40 -0
  292. package/dist/serve/vite-generation-middleware.js.map +1 -0
  293. package/dist/serve/vite-generation-rules-watch.d.ts +8 -0
  294. package/dist/serve/vite-generation-rules-watch.d.ts.map +1 -0
  295. package/dist/serve/vite-generation-rules-watch.js +33 -0
  296. package/dist/serve/vite-generation-rules-watch.js.map +1 -0
  297. package/dist/serve/vite-module-swap.d.ts +16 -0
  298. package/dist/serve/vite-module-swap.d.ts.map +1 -0
  299. package/dist/serve/vite-module-swap.js +96 -0
  300. package/dist/serve/vite-module-swap.js.map +1 -0
  301. package/dist/serve/vite-page-runtime.d.ts +29 -0
  302. package/dist/serve/vite-page-runtime.d.ts.map +1 -0
  303. package/dist/serve/vite-page-runtime.js +71 -0
  304. package/dist/serve/vite-page-runtime.js.map +1 -0
  305. package/dist/serve/vite-plugin.d.ts +44 -4
  306. package/dist/serve/vite-plugin.d.ts.map +1 -1
  307. package/dist/serve/vite-plugin.js +62 -864
  308. package/dist/serve/vite-plugin.js.map +1 -1
  309. package/dist/serve/vite-sandbox-generation.d.ts +57 -0
  310. package/dist/serve/vite-sandbox-generation.d.ts.map +1 -0
  311. package/dist/serve/vite-sandbox-generation.js +178 -0
  312. package/dist/serve/vite-sandbox-generation.js.map +1 -0
  313. package/dist/serve/vite-worker-runtime.d.ts +1 -1
  314. package/dist/serve/vite-worker-runtime.d.ts.map +1 -1
  315. package/dist/serve/vite-worker-runtime.js +8 -4
  316. package/dist/serve/vite-worker-runtime.js.map +1 -1
  317. package/dist/serve/worker/client/disconnect.d.ts.map +1 -1
  318. package/dist/serve/worker/client/disconnect.js +2 -0
  319. package/dist/serve/worker/client/disconnect.js.map +1 -1
  320. package/dist/serve/worker/client/handles.d.ts +5 -0
  321. package/dist/serve/worker/client/handles.d.ts.map +1 -1
  322. package/dist/serve/worker/client/handles.js.map +1 -1
  323. package/dist/serve/worker/client/pagehide.d.ts +13 -0
  324. package/dist/serve/worker/client/pagehide.d.ts.map +1 -0
  325. package/dist/serve/worker/client/pagehide.js +19 -0
  326. package/dist/serve/worker/client/pagehide.js.map +1 -0
  327. package/dist/serve/worker/client/rtdb-admin.d.ts +8 -0
  328. package/dist/serve/worker/client/rtdb-admin.d.ts.map +1 -0
  329. package/dist/serve/worker/client/rtdb-admin.js +39 -0
  330. package/dist/serve/worker/client/rtdb-admin.js.map +1 -0
  331. package/dist/serve/worker/client/rtdb-connection-lifecycle.d.ts +15 -0
  332. package/dist/serve/worker/client/rtdb-connection-lifecycle.d.ts.map +1 -0
  333. package/dist/serve/worker/client/rtdb-connection-lifecycle.js +45 -0
  334. package/dist/serve/worker/client/rtdb-connection-lifecycle.js.map +1 -0
  335. package/dist/serve/worker/client/rtdb-controls.d.ts +6 -0
  336. package/dist/serve/worker/client/rtdb-controls.d.ts.map +1 -0
  337. package/dist/serve/worker/client/rtdb-controls.js +8 -0
  338. package/dist/serve/worker/client/rtdb-controls.js.map +1 -0
  339. package/dist/serve/worker/client/rtdb-listeners.d.ts +24 -0
  340. package/dist/serve/worker/client/rtdb-listeners.d.ts.map +1 -0
  341. package/dist/serve/worker/client/rtdb-listeners.js +262 -0
  342. package/dist/serve/worker/client/rtdb-listeners.js.map +1 -0
  343. package/dist/serve/worker/client/rtdb-reads.d.ts +4 -0
  344. package/dist/serve/worker/client/rtdb-reads.d.ts.map +1 -0
  345. package/dist/serve/worker/client/rtdb-reads.js +11 -0
  346. package/dist/serve/worker/client/rtdb-reads.js.map +1 -0
  347. package/dist/serve/worker/client/rtdb-references.d.ts +19 -0
  348. package/dist/serve/worker/client/rtdb-references.d.ts.map +1 -0
  349. package/dist/serve/worker/client/rtdb-references.js +63 -0
  350. package/dist/serve/worker/client/rtdb-references.js.map +1 -0
  351. package/dist/serve/worker/client/rtdb-snapshots.d.ts +20 -0
  352. package/dist/serve/worker/client/rtdb-snapshots.d.ts.map +1 -0
  353. package/dist/serve/worker/client/rtdb-snapshots.js +64 -0
  354. package/dist/serve/worker/client/rtdb-snapshots.js.map +1 -0
  355. package/dist/serve/worker/client/rtdb-transactions.d.ts +14 -0
  356. package/dist/serve/worker/client/rtdb-transactions.d.ts.map +1 -0
  357. package/dist/serve/worker/client/rtdb-transactions.js +34 -0
  358. package/dist/serve/worker/client/rtdb-transactions.js.map +1 -0
  359. package/dist/serve/worker/client/rtdb-writes.d.ts +8 -0
  360. package/dist/serve/worker/client/rtdb-writes.d.ts.map +1 -0
  361. package/dist/serve/worker/client/rtdb-writes.js +65 -0
  362. package/dist/serve/worker/client/rtdb-writes.js.map +1 -0
  363. package/dist/serve/worker/client.d.ts +0 -2
  364. package/dist/serve/worker/client.d.ts.map +1 -1
  365. package/dist/serve/worker/client.js +0 -2
  366. package/dist/serve/worker/client.js.map +1 -1
  367. package/dist/serve/worker/entry.js +2 -2
  368. package/dist/serve/worker/entry.js.map +1 -1
  369. package/dist/serve/worker/host/dispatch.d.ts +2 -0
  370. package/dist/serve/worker/host/dispatch.d.ts.map +1 -1
  371. package/dist/serve/worker/host/dispatch.js +24 -2
  372. package/dist/serve/worker/host/dispatch.js.map +1 -1
  373. package/dist/serve/worker/host/rtdb.d.ts +6 -2
  374. package/dist/serve/worker/host/rtdb.d.ts.map +1 -1
  375. package/dist/serve/worker/host/rtdb.js +224 -2
  376. package/dist/serve/worker/host/rtdb.js.map +1 -1
  377. package/dist/serve/worker/host/studio.d.ts.map +1 -1
  378. package/dist/serve/worker/host/studio.js +2 -0
  379. package/dist/serve/worker/host/studio.js.map +1 -1
  380. package/dist/serve/worker/host/subscriptions.d.ts.map +1 -1
  381. package/dist/serve/worker/host/subscriptions.js +3 -3
  382. package/dist/serve/worker/host/subscriptions.js.map +1 -1
  383. package/dist/serve/worker/host.d.ts +1 -1
  384. package/dist/serve/worker/host.d.ts.map +1 -1
  385. package/dist/serve/worker/host.js +1 -1
  386. package/dist/serve/worker/host.js.map +1 -1
  387. package/dist/serve/worker/index.d.ts +16 -1
  388. package/dist/serve/worker/index.d.ts.map +1 -1
  389. package/dist/serve/worker/index.js +17 -4
  390. package/dist/serve/worker/index.js.map +1 -1
  391. package/dist/serve/worker/protocol.d.ts +57 -0
  392. package/dist/serve/worker/protocol.d.ts.map +1 -1
  393. package/dist/serve/worker/protocol.js.map +1 -1
  394. package/dist/serve/worker/rtdb-value-equality.d.ts +3 -0
  395. package/dist/serve/worker/rtdb-value-equality.d.ts.map +1 -0
  396. package/dist/serve/worker/rtdb-value-equality.js +18 -0
  397. package/dist/serve/worker/rtdb-value-equality.js.map +1 -0
  398. package/dist/serve/worker/serve-init.js +2 -2
  399. package/dist/serve/worker/serve-init.js.map +1 -1
  400. package/dist/serve/worker/service-worker-relay.js +2 -2
  401. package/dist/serve/worker/service-worker-relay.js.map +1 -1
  402. package/package.json +7 -5
  403. package/src/assurance/.generated/conformance-verdicts.ts +120 -75
  404. package/src/cli/serve.ts +216 -308
  405. package/src/cli/service-command-records/database-rules-generate.ts +3 -0
  406. package/src/cli/service-command-records/database-rules-lint.ts +3 -0
  407. package/src/cli/service-command-records/database-rules-simulate.ts +3 -0
  408. package/src/cli/service-command-records/database-rules-validate.ts +3 -0
  409. package/src/cli/service-command-records/firestore-indexes-generate.ts +3 -0
  410. package/src/cli/service-command-records/firestore-rules-lint.ts +3 -0
  411. package/src/cli/service-command-records/firestore-rules-resolve.ts +3 -0
  412. package/src/cli/service-command-records/firestore-rules-simulate.ts +3 -0
  413. package/src/cli/service-command-records/firestore-rules-validate.ts +3 -0
  414. package/src/cli/service-command-records/storage-rules-lint.ts +3 -0
  415. package/src/cli/service-command-records/storage-rules-simulate.ts +3 -0
  416. package/src/cli/service-commands.generated.ts +27 -0
  417. package/src/cli/service-commands.test.ts +43 -0
  418. package/src/cli/service-commands.ts +36 -51
  419. package/src/conformance/.generated/can-i-use-browser.ts +1 -1
  420. package/src/conformance/.generated/can-i-use.ts +1 -1
  421. package/src/conformance/.generated/conformance-docs.ts +1 -1
  422. package/src/functions-rtdb/development-runtime.ts +299 -0
  423. package/src/serve/bridge-mount.ts +253 -19
  424. package/src/serve/bundler.ts +17 -36
  425. package/src/serve/entries/app-client.ts +5 -4
  426. package/src/serve/entries/auth-helper-core.ts +83 -30
  427. package/src/serve/entries/database.ts +180 -57
  428. package/src/serve/entries/init.ts +30 -20
  429. package/src/serve/html-injection.ts +65 -0
  430. package/src/serve/namespace.ts +26 -169
  431. package/src/serve/runtime/worker-generation.ts +29 -7
  432. package/src/serve/runtime/worker-replacement.ts +1 -1
  433. package/src/serve/sandbox-session.ts +233 -0
  434. package/src/serve/server.ts +20 -5
  435. package/src/serve/site-tree.ts +146 -0
  436. package/src/serve/standalone-assets.ts +9 -26
  437. package/src/serve/vite-ai-config.ts +8 -0
  438. package/src/serve/vite-functions-development.ts +201 -0
  439. package/src/serve/vite-generation-bridge.ts +66 -0
  440. package/src/serve/vite-generation-functions.ts +78 -0
  441. package/src/serve/vite-generation-middleware.ts +56 -0
  442. package/src/serve/vite-generation-rules-watch.ts +37 -0
  443. package/src/serve/vite-module-swap.ts +119 -0
  444. package/src/serve/vite-page-runtime.ts +100 -0
  445. package/src/serve/vite-plugin.ts +78 -882
  446. package/src/serve/vite-sandbox-generation.ts +255 -0
  447. package/src/serve/vite-worker-runtime.ts +12 -5
  448. package/src/serve/worker/client/disconnect.ts +3 -1
  449. package/src/serve/worker/client/handles.ts +5 -0
  450. package/src/serve/worker/client/pagehide.ts +31 -0
  451. package/src/serve/worker/client/rtdb-admin.ts +74 -0
  452. package/src/serve/worker/client/rtdb-connection-lifecycle.ts +52 -0
  453. package/src/serve/worker/client/rtdb-controls.ts +8 -0
  454. package/src/serve/worker/client/rtdb-listeners.ts +337 -0
  455. package/src/serve/worker/client/rtdb-reads.ts +12 -0
  456. package/src/serve/worker/client/rtdb-references.ts +85 -0
  457. package/src/serve/worker/client/rtdb-snapshots.ts +118 -0
  458. package/src/serve/worker/client/rtdb-transactions.ts +51 -0
  459. package/src/serve/worker/client/rtdb-writes.ts +74 -0
  460. package/src/serve/worker/client.ts +0 -2
  461. package/src/serve/worker/entry.ts +2 -2
  462. package/src/serve/worker/host/dispatch.ts +22 -2
  463. package/src/serve/worker/host/rtdb.ts +243 -2
  464. package/src/serve/worker/host/studio.ts +2 -0
  465. package/src/serve/worker/host/subscriptions.ts +8 -4
  466. package/src/serve/worker/host.ts +1 -1
  467. package/src/serve/worker/index.ts +58 -10
  468. package/src/serve/worker/protocol.ts +23 -2
  469. package/src/serve/worker/rtdb-value-equality.ts +17 -0
  470. package/src/serve/worker/serve-init.ts +2 -2
  471. package/src/serve/worker/service-worker-relay.ts +2 -2
  472. package/dist/serve/docs-ui/_astro/_slug_.DUci-duz.css +0 -1
  473. package/dist/serve/docs-ui/docs/_rhythm/index.html +0 -100
  474. package/dist/serve/docs-ui/docs/agent/set-up-your-agent/index.html +0 -43
  475. package/dist/serve/docs-ui/docs/agent/watch-and-review/index.html +0 -26
  476. package/dist/serve/docs-ui/docs/agent/work-with-an-agent/index.html +0 -70
  477. package/dist/serve/docs-ui/docs/api-reference/index.html +0 -68
  478. package/dist/serve/docs-ui/docs/build/ai-logic/index.html +0 -64
  479. package/dist/serve/docs-ui/docs/build/authentication/index.html +0 -66
  480. package/dist/serve/docs-ui/docs/build/cloud-firestore/index.html +0 -70
  481. package/dist/serve/docs-ui/docs/build/cloud-messaging/index.html +0 -71
  482. package/dist/serve/docs-ui/docs/build/cloud-storage/index.html +0 -66
  483. package/dist/serve/docs-ui/docs/build/realtime-database/index.html +0 -67
  484. package/dist/serve/docs-ui/docs/conformance-scores/index.html +0 -50
  485. package/dist/serve/docs-ui/docs/create-pyric-reference-api/index.html +0 -531
  486. package/dist/serve/docs-ui/docs/functions-rtdb-compat/index.html +0 -73
  487. package/dist/serve/docs-ui/docs/get-started/how-the-swap-works/index.html +0 -29
  488. package/dist/serve/docs-ui/docs/get-started/start-building/index.html +0 -33
  489. package/dist/serve/docs-ui/docs/messaging-compat/index.html +0 -265
  490. package/dist/serve/docs-ui/docs/observe/resolve-runtime-status/index.html +0 -28
  491. package/dist/serve/docs-ui/docs/observe/see-whats-happening/index.html +0 -74
  492. package/dist/serve/docs-ui/docs/observe/shape-your-data/index.html +0 -45
  493. package/dist/serve/docs-ui/docs/overview/index.html +0 -17
  494. package/dist/serve/docs-ui/docs/pyric-admin-app-reference-api/index.html +0 -186
  495. package/dist/serve/docs-ui/docs/pyric-admin-storage-reference-api/index.html +0 -318
  496. package/dist/serve/docs-ui/docs/pyric-ai-scripting-reference-api/index.html +0 -160
  497. package/dist/serve/docs-ui/docs/pyric-app-reference-api/index.html +0 -425
  498. package/dist/serve/docs-ui/docs/pyric-cli-assurance-browser-reference-api/index.html +0 -60
  499. package/dist/serve/docs-ui/docs/pyric-cli-bridge-reference-api/index.html +0 -507
  500. package/dist/serve/docs-ui/docs/pyric-cli-conformance-browser-reference-api/index.html +0 -258
  501. package/dist/serve/docs-ui/docs/pyric-cli-conformance-docs-reference-api/index.html +0 -51
  502. package/dist/serve/docs-ui/docs/pyric-cli-conformance-reference-api/index.html +0 -308
  503. package/dist/serve/docs-ui/docs/pyric-cli-credentials-node-reference-api/index.html +0 -68
  504. package/dist/serve/docs-ui/docs/pyric-cli-register-reference-api/index.html +0 -11
  505. package/dist/serve/docs-ui/docs/pyric-cli-vite-reference-api/index.html +0 -126
  506. package/dist/serve/docs-ui/docs/pyric-database-reference-api/index.html +0 -1852
  507. package/dist/serve/docs-ui/docs/pyric-messaging-reference-api/index.html +0 -509
  508. package/dist/serve/docs-ui/docs/pyric-messaging-sw-reference-api/index.html +0 -182
  509. package/dist/serve/docs-ui/docs/pyric-sandbox-database-reference-api/index.html +0 -121
  510. package/dist/serve/docs-ui/docs/pyric-sandbox-firestore-reference-api/index.html +0 -203
  511. package/dist/serve/docs-ui/docs/pyric-ui-agents-reference-api/index.html +0 -639
  512. package/dist/serve/docs-ui/docs/pyric-ui-auth-hooks-reference-api/index.html +0 -100
  513. package/dist/serve/docs-ui/docs/pyric-ui-events-hooks-reference-api/index.html +0 -24
  514. package/dist/serve/docs-ui/docs/pyric-ui-firestore-hooks-reference-api/index.html +0 -136
  515. package/dist/serve/docs-ui/docs/pyric-ui-rules-hooks-reference-api/index.html +0 -16
  516. package/dist/serve/docs-ui/docs/pyric-ui-storage-hooks-reference-api/index.html +0 -176
  517. package/dist/serve/docs-ui/docs/pyric-ui-traffic-hooks-reference-api/index.html +0 -188
  518. package/dist/serve/docs-ui/docs/secure/audit-your-rules/index.html +0 -51
  519. package/dist/serve/docs-ui/docs/secure/firestore-rules-limits/index.html +0 -106
  520. package/dist/serve/docs-ui/docs/secure/read-a-denial/index.html +0 -41
  521. package/dist/serve/docs-ui/docs/secure/rtdb-rules-in-typescript/index.html +0 -67
  522. package/dist/serve/docs-ui/docs/secure/rules-standard-library/index.html +0 -159
  523. package/dist/serve/docs-ui/docs/secure/secure-it-with-rules/index.html +0 -47
  524. package/dist/serve/docs-ui/docs/secure/simulate-and-lint/index.html +0 -95
  525. package/dist/serve/docs-ui/docs/secure/write-a-rules-test-suite/index.html +0 -82
  526. package/dist/serve/docs-ui/docs/ship/ship-to-production/index.html +0 -37
  527. package/dist/serve/docs-ui/docs/ship/test-in-node/index.html +0 -75
  528. package/dist/serve/docs-ui/docs/trust/how-we-know-it-matches-firebase/index.html +0 -132
  529. package/dist/serve/docs-ui/docs/trust/versioning-and-compatibility/index.html +0 -14
  530. package/dist/serve/docs-ui/index.html +0 -1
  531. package/dist/serve/studio-ui/assets/RulesCodeEditor-BDlH-5lp.js +0 -23
  532. package/dist/serve/studio-ui/assets/index-Bf9SSE8L.js +0 -1218
  533. package/dist/serve/studio-ui/assets/index-BlSGru_r.css +0 -1
  534. package/dist/serve/studio-ui/assets/seed-D_UjxfOU.js +0 -20
  535. package/dist/serve/studio-ui/index.html +0 -32
  536. package/dist/serve/worker/client/rtdb.d.ts +0 -36
  537. package/dist/serve/worker/client/rtdb.d.ts.map +0 -1
  538. package/dist/serve/worker/client/rtdb.js +0 -241
  539. package/dist/serve/worker/client/rtdb.js.map +0 -1
  540. package/src/serve/worker/client/rtdb.ts +0 -311
  541. /package/dist/serve/{docs-ui → site-ui}/404.html +0 -0
  542. /package/dist/serve/{docs-ui → site-ui}/_astro/_slug_.CXh9yTP1.css +0 -0
  543. /package/dist/serve/{docs-ui → site-ui}/docs/_rhythm.md +0 -0
  544. /package/dist/serve/{docs-ui → site-ui}/docs/agent/set-up-your-agent.md +0 -0
  545. /package/dist/serve/{docs-ui → site-ui}/docs/agent/watch-and-review.md +0 -0
  546. /package/dist/serve/{docs-ui → site-ui}/docs/agent/work-with-an-agent.md +0 -0
  547. /package/dist/serve/{docs-ui → site-ui}/docs/ai-compat.md +0 -0
  548. /package/dist/serve/{docs-ui → site-ui}/docs/api-reference.md +0 -0
  549. /package/dist/serve/{docs-ui → site-ui}/docs/app-compat.md +0 -0
  550. /package/dist/serve/{docs-ui → site-ui}/docs/auth-compat.md +0 -0
  551. /package/dist/serve/{docs-ui → site-ui}/docs/build/ai-logic.md +0 -0
  552. /package/dist/serve/{docs-ui → site-ui}/docs/build/authentication.md +0 -0
  553. /package/dist/serve/{docs-ui → site-ui}/docs/build/cloud-firestore.md +0 -0
  554. /package/dist/serve/{docs-ui → site-ui}/docs/build/cloud-messaging.md +0 -0
  555. /package/dist/serve/{docs-ui → site-ui}/docs/build/realtime-database.md +0 -0
  556. /package/dist/serve/{docs-ui → site-ui}/docs/create-pyric-reference-api.md +0 -0
  557. /package/dist/serve/{docs-ui → site-ui}/docs/functions-rtdb-compat.md +0 -0
  558. /package/dist/serve/{docs-ui → site-ui}/docs/get-started/how-the-swap-works.md +0 -0
  559. /package/dist/serve/{docs-ui → site-ui}/docs/get-started/start-building.md +0 -0
  560. /package/dist/serve/{docs-ui → site-ui}/docs/index.html +0 -0
  561. /package/dist/serve/{docs-ui → site-ui}/docs/observe/resolve-runtime-status.md +0 -0
  562. /package/dist/serve/{docs-ui → site-ui}/docs/observe/see-whats-happening.md +0 -0
  563. /package/dist/serve/{docs-ui → site-ui}/docs/observe/shape-your-data.md +0 -0
  564. /package/dist/serve/{docs-ui → site-ui}/docs/overview.md +0 -0
  565. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-admin-app-reference-api.md +0 -0
  566. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-admin-auth-reference-api.md +0 -0
  567. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-admin-database-reference-api.md +0 -0
  568. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-admin-messaging-reference-api.md +0 -0
  569. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-admin-storage-reference-api.md +0 -0
  570. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ai-reference-api.md +0 -0
  571. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ai-scripting-reference-api.md +0 -0
  572. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-app-reference-api.md +0 -0
  573. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-auth-reference-api.md +0 -0
  574. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-assurance-browser-reference-api.md +0 -0
  575. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-assurance-reference-api.md +0 -0
  576. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-bridge-client-reference-api.md +0 -0
  577. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-bridge-reference-api.md +0 -0
  578. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-conformance-browser-reference-api.md +0 -0
  579. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-conformance-docs-reference-api.md +0 -0
  580. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-conformance-reference-api.md +0 -0
  581. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-credentials-node-reference-api.md +0 -0
  582. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-discover-reference-api.md +0 -0
  583. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-register-reference-api.md +0 -0
  584. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-remote-reference-api.md +0 -0
  585. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-cli-verify-reference-api.md +0 -0
  586. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-messaging-reference-api.md +0 -0
  587. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-messaging-sw-reference-api.md +0 -0
  588. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-sandbox-database-reference-api.md +0 -0
  589. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-sandbox-firestore-reference-api.md +0 -0
  590. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-agents-reference-api.md +0 -0
  591. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-auth-hooks-reference-api.md +0 -0
  592. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-auth-reference-api.md +0 -0
  593. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-events-hooks-reference-api.md +0 -0
  594. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-events-reference-api.md +0 -0
  595. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-firestore-hooks-reference-api.md +0 -0
  596. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-primitives-reference-api.md +0 -0
  597. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-rtdb-reference-api.md +0 -0
  598. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-rules-hooks-reference-api.md +0 -0
  599. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-rules-reference-api.md +0 -0
  600. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-storage-hooks-reference-api.md +0 -0
  601. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-traffic-hooks-reference-api.md +0 -0
  602. /package/dist/serve/{docs-ui → site-ui}/docs/pyric-ui-traffic-reference-api.md +0 -0
  603. /package/dist/serve/{docs-ui → site-ui}/docs/secure/audit-your-rules.md +0 -0
  604. /package/dist/serve/{docs-ui → site-ui}/docs/secure/firestore-rules-limits.md +0 -0
  605. /package/dist/serve/{docs-ui → site-ui}/docs/secure/read-a-denial.md +0 -0
  606. /package/dist/serve/{docs-ui → site-ui}/docs/secure/rtdb-rules-in-typescript.md +0 -0
  607. /package/dist/serve/{docs-ui → site-ui}/docs/secure/secure-it-with-rules.md +0 -0
  608. /package/dist/serve/{docs-ui → site-ui}/docs/secure/simulate-and-lint.md +0 -0
  609. /package/dist/serve/{docs-ui → site-ui}/docs/secure/write-a-rules-test-suite.md +0 -0
  610. /package/dist/serve/{docs-ui → site-ui}/docs/ship/ship-to-production.md +0 -0
  611. /package/dist/serve/{docs-ui → site-ui}/docs/ship/test-in-node.md +0 -0
  612. /package/dist/serve/{docs-ui → site-ui}/docs/trust/how-we-know-it-matches-firebase.md +0 -0
  613. /package/dist/serve/{docs-ui → site-ui}/docs/trust/versioning-and-compatibility.md +0 -0
  614. /package/dist/serve/{studio-ui → site-ui}/pyric-logo.svg +0 -0
@@ -0,0 +1,2641 @@
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/database · Pyric Studio</title><meta name="description" content="Published declarations for pyric/database."><link rel="icon" type="image/svg+xml" href="/__pyric/ui/pyric-logo.svg"><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_.BoKXYrnu.css"></head> <body> <header class="studio__bar" data-astro-cid-mw7aashj> <div class="studio__bar-inner" data-astro-cid-mw7aashj> <a class="studio__brand" href="/__pyric/ui/" aria-label="Pyric Studio" data-astro-cid-mw7aashj>Pyric</a> <nav class="studio__nav" aria-label="Studio tabs" data-astro-cid-mw7aashj> <a class="studio__nav-tab" href="/__pyric/ui/" data-astro-cid-mw7aashj> Home </a><a class="studio__nav-tab" href="/__pyric/ui/firestore" data-astro-cid-mw7aashj> Firestore </a><a class="studio__nav-tab" href="/__pyric/ui/auth" data-astro-cid-mw7aashj> Auth </a><a class="studio__nav-tab" href="/__pyric/ui/rtdb" data-astro-cid-mw7aashj> RTDB </a><a class="studio__nav-tab" href="/__pyric/ui/storage" data-astro-cid-mw7aashj> Storage </a><a class="studio__nav-tab" href="/__pyric/ui/traffic" data-astro-cid-mw7aashj> Traffic </a><a class="studio__nav-tab" href="/__pyric/ui/settings" data-astro-cid-mw7aashj> Settings </a><a class="studio__nav-tab" href="/__pyric/ui/docs" aria-current="page" data-astro-cid-mw7aashj> Docs </a> </nav> </div> </header> <div class="docs-shell" data-astro-cid-mw7aashj> <details class="docs-nav-drawer" data-astro-cid-mw7aashj> <summary data-astro-cid-mw7aashj>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> <details class="docs-nav-group"> <summary>Overview</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/overview/"> Overview </a> </li><li> <a href="/__pyric/ui/docs/tutorial/"> Tutorial </a> </li><li> <a href="/__pyric/ui/docs/examples/"> Examples </a> </li> </ul> </div> </div> </details><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 &amp; 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 class="docs-nav-section"> <h2 class="docs-nav-heading"> Examples </h2> <ul> <li> <a href="/__pyric/ui/docs/examples/chess/"> Chess showcase </a> </li> </ul> </div> </div> </details><details class="docs-nav-group"> <summary>Observe &amp; 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 &amp; rule verdicts </a> </li><li> <a href="/__pyric/ui/docs/observe/resolve-runtime-status/"> Runtime status </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 &amp; 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><details class="docs-nav-group"> <summary>Trust</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/trust/versioning-and-compatibility/"> Versioning and the fb tag </a> </li><li> <a href="/__pyric/ui/docs/trust/storage-rules-stdlib-research/"> Storage Rules modules: evidence and design </a> </li><li> <a href="/__pyric/ui/docs/trust/rules-standard-library/"> Rules standard library reference </a> </li> </ul> </div> </div> </details><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/"> 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/" aria-current="page"> 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-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><li> <a href="/__pyric/ui/docs/pyric-admin-messaging-reference-api/"> pyric-admin/messaging </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> <details class="docs-nav-group" id="nav-group-overview"> <summary>Overview</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/overview/"> Overview </a> </li><li> <a href="/__pyric/ui/docs/tutorial/"> Tutorial </a> </li><li> <a href="/__pyric/ui/docs/examples/"> Examples </a> </li> </ul> </div> </div> </details><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 &amp; 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 class="docs-nav-section"> <h2 class="docs-nav-heading" id="nav-section-secure-debug-examples"> Examples </h2> <ul> <li> <a href="/__pyric/ui/docs/examples/chess/"> Chess showcase </a> </li> </ul> </div> </div> </details><details class="docs-nav-group" id="nav-group-observe-shape"> <summary>Observe &amp; 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 &amp; rule verdicts </a> </li><li> <a href="/__pyric/ui/docs/observe/resolve-runtime-status/"> Runtime status </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 &amp; 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><details class="docs-nav-group" id="nav-group-trust"> <summary>Trust</summary> <div class="docs-nav-group-body"> <div class="docs-nav-section"> <ul> <li> <a href="/__pyric/ui/docs/trust/versioning-and-compatibility/"> Versioning and the fb tag </a> </li><li> <a href="/__pyric/ui/docs/trust/storage-rules-stdlib-research/"> Storage Rules modules: evidence and design </a> </li><li> <a href="/__pyric/ui/docs/trust/rules-standard-library/"> Rules standard library reference </a> </li> </ul> </div> </div> </details><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/"> 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/" aria-current="page"> 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-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><li> <a href="/__pyric/ui/docs/pyric-admin-messaging-reference-api/"> pyric-admin/messaging </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" data-astro-cid-mw7aashj> <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/database</span> </li> </ol> </nav> <header class="api-reference-header" data-astro-cid-mw7aashj> <p class="api-reference-kicker" data-astro-cid-mw7aashj>API reference</p> <h1 data-astro-cid-mw7aashj><code data-astro-cid-mw7aashj>pyric/database</code></h1> <p class="api-reference-meta" data-astro-cid-mw7aashj> 67 published symbols from <code data-astro-cid-mw7aashj>pyric</code> </p> <p class="api-reference-source" data-astro-cid-mw7aashj>
3
+ Generated from the TypeScript declarations shipped at this import path.
4
+ </p> <a class="api-reference-evidence" href="/__pyric/ui/docs/database-compat/" data-astro-cid-mw7aashj>
5
+ Check behavioral conformance
6
+ </a> </header> <article class="prose api-reference-body" data-astro-cid-mw7aashj> <!-- Generated from published package declarations via TypeDoc. Rendered by the api-reference content loader. -->
7
+ <h2 id="classes">Classes</h2>
8
+ <p><a id="database"></a></p>
9
+ <h3 id="database">Database</h3>
10
+ <p>Opaque RTDB handle. Routes via <a href="#target_symbol-1">TARGET_SYMBOL</a>.</p>
11
+ <h4 id="constructors">Constructors</h4>
12
+ <p><a id="constructor"></a></p>
13
+ <h5 id="constructor">Constructor</h5>
14
+ <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"> Database</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">target</span><span style="color:#C678DD">?:</span><span style="color:#E06C75"> Target</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">app</span><span style="color:#C678DD">?:</span><span style="color:#E06C75"> FirebaseApp</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">Database</span><span style="color:#ABB2BF">;</span></span></code></pre>
15
+ <h6 id="parameters">Parameters</h6>
16
+ <div class="table-scroll">
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+ <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>Target</code></td></tr><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>
34
+ <h6 id="returns">Returns</h6>
35
+ <p><a href="#database"><code>Database</code></a></p>
36
+ <h4 id="properties">Properties</h4>
37
+ <div class="table-scroll">
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+ <table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th><th align="left">Default value</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><td align="left"><code>undefined</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><td align="left"><code>undefined</code></td></tr><tr><td align="left"><a id="type"></a> <code>type</code></td><td align="left"><code>readonly</code></td><td align="left"><code>"database"</code></td><td align="left"><code>"database"</code></td></tr></tbody></table></div>
67
+ <hr>
68
+ <p><a id="datasnapshot"></a></p>
69
+ <h3 id="datasnapshot">DataSnapshot</h3>
70
+ <p>Firebase-shaped RTDB snapshot runtime value.</p>
71
+ <h4 id="extended-by">Extended by</h4>
72
+ <ul>
73
+ <li><a href="#iterateddatasnapshot"><code>IteratedDataSnapshot</code></a></li>
74
+ </ul>
75
+ <h4 id="constructors-1">Constructors</h4>
76
+ <p><a id="constructor-1"></a></p>
77
+ <h5 id="constructor-1">Constructor</h5>
78
+ <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"> DataSnapshot</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">implementation</span><span style="color:#C678DD">?:</span><span style="color:#E06C75"> DataSnapshotImplementation</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">DataSnapshot</span><span style="color:#ABB2BF">;</span></span></code></pre>
79
+ <h6 id="parameters-1">Parameters</h6>
80
+ <div class="table-scroll">
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>implementation?</code></td><td align="left"><a href="#datasnapshotimplementation"><code>DataSnapshotImplementation</code></a></td></tr></tbody></table></div>
94
+ <h6 id="returns-1">Returns</h6>
95
+ <p><a href="#datasnapshot"><code>DataSnapshot</code></a></p>
96
+ <h4 id="properties-1">Properties</h4>
97
+ <div class="table-scroll">
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+ <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="ref"></a> <code>ref</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr></tbody></table></div>
113
+ <h4 id="accessors">Accessors</h4>
114
+ <p><a id="key"></a></p>
115
+ <h5 id="key">key</h5>
116
+ <h6 id="get-signature">Get Signature</h6>
117
+ <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"> key</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">;</span></span></code></pre>
118
+ <h6 id="returns-2">Returns</h6>
119
+ <p><code>string</code></p>
120
+ <p><a id="priority"></a></p>
121
+ <h5 id="priority">priority</h5>
122
+ <h6 id="get-signature-1">Get Signature</h6>
123
+ <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"> priority</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">string</span><span style="color:#56B6C2"> |</span><span style="color:#E06C75"> number</span><span style="color:#ABB2BF">;</span></span></code></pre>
124
+ <h6 id="returns-3">Returns</h6>
125
+ <p><code>string</code> | <code>number</code></p>
126
+ <p><a id="size"></a></p>
127
+ <h5 id="size">size</h5>
128
+ <h6 id="get-signature-2">Get Signature</h6>
129
+ <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"> size</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">;</span></span></code></pre>
130
+ <h6 id="returns-4">Returns</h6>
131
+ <p><code>number</code></p>
132
+ <h4 id="methods">Methods</h4>
133
+ <p><a id="child"></a></p>
134
+ <h5 id="child">child()</h5>
135
+ <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">child</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">DataSnapshot</span><span style="color:#ABB2BF">;</span></span></code></pre>
136
+ <h6 id="parameters-2">Parameters</h6>
137
+ <div class="table-scroll">
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
151
+ <h6 id="returns-5">Returns</h6>
152
+ <p><a href="#datasnapshot"><code>DataSnapshot</code></a></p>
153
+ <p><a id="exists"></a></p>
154
+ <h5 id="exists">exists()</h5>
155
+ <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">exists</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
156
+ <h6 id="returns-6">Returns</h6>
157
+ <p><code>boolean</code></p>
158
+ <p><a id="exportval"></a></p>
159
+ <h5 id="exportval">exportVal()</h5>
160
+ <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">exportVal</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">JsonValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
161
+ <h6 id="returns-7">Returns</h6>
162
+ <p><a href="#jsonvalue"><code>JsonValue</code></a></p>
163
+ <p><a id="foreach"></a></p>
164
+ <h5 id="foreach">forEach()</h5>
165
+ <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">forEach</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">cb</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">child</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DataSnapshot</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E06C75"> boolean</span><span style="color:#56B6C2"> |</span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
166
+ <h6 id="parameters-3">Parameters</h6>
167
+ <div class="table-scroll">
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+ <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>child</code>: <a href="#datasnapshot"><code>DataSnapshot</code></a>) => <code>boolean</code> | <code>void</code></td></tr></tbody></table></div>
181
+ <h6 id="returns-8">Returns</h6>
182
+ <p><code>boolean</code></p>
183
+ <p><a id="haschild"></a></p>
184
+ <h5 id="haschild">hasChild()</h5>
185
+ <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">hasChild</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
186
+ <h6 id="parameters-4">Parameters</h6>
187
+ <div class="table-scroll">
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
201
+ <h6 id="returns-9">Returns</h6>
202
+ <p><code>boolean</code></p>
203
+ <p><a id="haschildren"></a></p>
204
+ <h5 id="haschildren">hasChildren()</h5>
205
+ <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">hasChildren</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
206
+ <h6 id="returns-10">Returns</h6>
207
+ <p><code>boolean</code></p>
208
+ <p><a id="tojson"></a></p>
209
+ <h5 id="tojson">toJSON()</h5>
210
+ <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">JsonValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
211
+ <h6 id="returns-11">Returns</h6>
212
+ <p><a href="#jsonvalue"><code>JsonValue</code></a></p>
213
+ <p><a id="val"></a></p>
214
+ <h5 id="val">val()</h5>
215
+ <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">val</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">JsonValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
216
+ <h6 id="returns-12">Returns</h6>
217
+ <p><a href="#jsonvalue"><code>JsonValue</code></a></p>
218
+ <hr>
219
+ <p><a id="ondisconnect"></a></p>
220
+ <h3 id="ondisconnect">OnDisconnect</h3>
221
+ <h4 id="methods-1">Methods</h4>
222
+ <p><a id="cancel"></a></p>
223
+ <h5 id="cancel">cancel()</h5>
224
+ <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">cancel</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2">&#x3C;</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
225
+ <h6 id="returns-13">Returns</h6>
226
+ <p><code>Promise</code>&#x3C;<code>void</code>></p>
227
+ <p><a id="remove"></a></p>
228
+ <h5 id="remove">remove()</h5>
229
+ <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">remove</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2">&#x3C;</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
230
+ <h6 id="returns-14">Returns</h6>
231
+ <p><code>Promise</code>&#x3C;<code>void</code>></p>
232
+ <p><a id="set"></a></p>
233
+ <h5 id="set">set()</h5>
234
+ <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">set</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">value</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">unknown</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2">&#x3C;</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
235
+ <h6 id="parameters-5">Parameters</h6>
236
+ <div class="table-scroll">
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>value</code></td><td align="left"><code>unknown</code></td></tr></tbody></table></div>
250
+ <h6 id="returns-15">Returns</h6>
251
+ <p><code>Promise</code>&#x3C;<code>void</code>></p>
252
+ <p><a id="setwithpriority"></a></p>
253
+ <h5 id="setwithpriority">setWithPriority()</h5>
254
+ <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">setWithPriority</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">value</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">unknown</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">priority</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#56B6C2"> |</span><span style="color:#E06C75"> number</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2">&#x3C;</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
255
+ <h6 id="parameters-6">Parameters</h6>
256
+ <div class="table-scroll">
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>value</code></td><td align="left"><code>unknown</code></td></tr><tr><td align="left"><code>priority</code></td><td align="left"><code>string</code> | <code>number</code></td></tr></tbody></table></div>
274
+ <h6 id="returns-16">Returns</h6>
275
+ <p><code>Promise</code>&#x3C;<code>void</code>></p>
276
+ <p><a id="update"></a></p>
277
+ <h5 id="update">update()</h5>
278
+ <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">update</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">values</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">Record</span><span style="color:#56B6C2">&#x3C;</span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">unknown</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2">&#x3C;</span><span style="color:#C678DD">void</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
279
+ <h6 id="parameters-7">Parameters</h6>
280
+ <div class="table-scroll">
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+ <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>Record</code>&#x3C;<code>string</code>, <code>unknown</code>></td></tr></tbody></table></div>
294
+ <h6 id="returns-17">Returns</h6>
295
+ <p><code>Promise</code>&#x3C;<code>void</code>></p>
296
+ <hr>
297
+ <p><a id="queryconstraint"></a></p>
298
+ <h3 id="queryconstraint">QueryConstraint</h3>
299
+ <p>Opaque constraint produced by the order/filter/limit query functions.</p>
300
+ <h4 id="constructors-2">Constructors</h4>
301
+ <p><a id="constructor-2"></a></p>
302
+ <h5 id="constructor-2">Constructor</h5>
303
+ <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"> QueryConstraint</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">type</span><span style="color:#C678DD">?:</span><span style="color:#E06C75"> QueryConstraintType</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">internal</span><span style="color:#C678DD">?:</span><span style="color:#E06C75"> Constraint</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
304
+ <h6 id="parameters-8">Parameters</h6>
305
+ <div class="table-scroll">
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+
322
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>type?</code></td><td align="left"><a href="#queryconstrainttype-1"><code>QueryConstraintType</code></a></td></tr><tr><td align="left"><code>internal?</code></td><td align="left"><code>Constraint</code></td></tr></tbody></table></div>
323
+ <h6 id="returns-18">Returns</h6>
324
+ <p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
325
+ <h4 id="properties-2">Properties</h4>
326
+ <div class="table-scroll">
327
+
328
+
329
+
330
+
331
+
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+ <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="constraint_symbol"></a> <code>[CONSTRAINT_SYMBOL]</code></td><td align="left"><code>readonly</code></td><td align="left"><code>Constraint</code></td></tr><tr><td align="left"><a id="type-1"></a> <code>type</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#queryconstrainttype-1"><code>QueryConstraintType</code></a></td></tr></tbody></table></div>
347
+ <hr>
348
+ <p><a id="transactionresult"></a></p>
349
+ <h3 id="transactionresult">TransactionResult</h3>
350
+ <p>Result of <a href="#runtransaction">runTransaction</a>. Matches <code>firebase/database</code>’s
351
+ <code>TransactionResult</code> for the fields agent / playground code reads
352
+ idiomatically.</p>
353
+ <p><code>committed === false</code> when the update fn aborted by returning
354
+ <code>undefined</code>. The snapshot still resolves — it reflects the <strong>pre-
355
+ transaction</strong> value (oracle:
356
+ <code>rtdb-modular-runtransaction-abort-undefined.json</code> →
357
+ <code>afterValOnServer: 100</code> preserved).</p>
358
+ <p>On rule denial the promise rejects with a plain <code>Error</code> whose
359
+ <code>message === 'permission_denied'</code> (lowercase, no <code>.code</code>); see
360
+ <code>rtdb-modular-runtransaction-on-rules-denied-path.json</code>.</p>
361
+ <h4 id="constructors-3">Constructors</h4>
362
+ <p><a id="constructor-3"></a></p>
363
+ <h5 id="constructor-3">Constructor</h5>
364
+ <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"> TransactionResult</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">committed</span><span style="color:#C678DD">?:</span><span style="color:#E06C75"> boolean</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">snapshot</span><span style="color:#C678DD">?:</span><span style="color:#E06C75"> DataSnapshot</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">TransactionResult</span><span style="color:#ABB2BF">;</span></span></code></pre>
365
+ <h6 id="parameters-9">Parameters</h6>
366
+ <div class="table-scroll">
367
+
368
+
369
+
370
+
371
+
372
+
373
+
374
+
375
+
376
+
377
+
378
+
379
+
380
+
381
+
382
+
383
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>committed?</code></td><td align="left"><code>boolean</code></td></tr><tr><td align="left"><code>snapshot?</code></td><td align="left"><a href="#datasnapshot"><code>DataSnapshot</code></a></td></tr></tbody></table></div>
384
+ <h6 id="returns-19">Returns</h6>
385
+ <p><a href="#transactionresult"><code>TransactionResult</code></a></p>
386
+ <h4 id="properties-3">Properties</h4>
387
+ <div class="table-scroll">
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+ <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="committed"></a> <code>committed</code></td><td align="left"><code>readonly</code></td><td align="left"><code>boolean</code></td></tr><tr><td align="left"><a id="snapshot"></a> <code>snapshot</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#datasnapshot"><code>DataSnapshot</code></a></td></tr></tbody></table></div>
408
+ <h4 id="methods-2">Methods</h4>
409
+ <p><a id="tojson-2"></a></p>
410
+ <h5 id="tojson-1">toJSON()</h5>
411
+ <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>
412
+ <span class="line"><span style="color:#E06C75"> committed</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span>
413
+ <span class="line"><span style="color:#E06C75"> snapshot</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">JsonValue</span><span style="color:#ABB2BF">;</span></span>
414
+ <span class="line"><span style="color:#ABB2BF">};</span></span></code></pre>
415
+ <h6 id="returns-20">Returns</h6>
416
+ <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>
417
+ <span class="line"><span style="color:#E06C75"> committed</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span>
418
+ <span class="line"><span style="color:#E06C75"> snapshot</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">JsonValue</span><span style="color:#ABB2BF">;</span></span>
419
+ <span class="line"><span style="color:#ABB2BF">}</span></span></code></pre>
420
+ <h6 id="committed">committed</h6>
421
+ <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">committed</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
422
+ <h6 id="snapshot">snapshot</h6>
423
+ <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">snapshot</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">JsonValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
424
+ <h2 id="interfaces">Interfaces</h2>
425
+ <p><a id="databasereference"></a></p>
426
+ <h3 id="databasereference">DatabaseReference</h3>
427
+ <p>RTDB-shaped reference. Backend-opaque to consumers; mirrors
428
+ <code>firebase/database</code>’s <code>DatabaseReference</code> for the subset of methods
429
+ the modular SDK uses idiomatically as plain free-function args.</p>
430
+ <p><code>key</code> is the last path segment (matches <code>DatabaseReference.key</code>).
431
+ <code>null</code> for the root ref. <code>parent</code> is the ref one segment up
432
+ (<code>null</code> at root). <code>root</code> is always the root ref.</p>
433
+ <p><code>toString()</code> returns a stable <code>sandbox://</code> URL.</p>
434
+ <h4 id="extends">Extends</h4>
435
+ <ul>
436
+ <li><a href="#query"><code>Query</code></a></li>
437
+ </ul>
438
+ <h4 id="extended-by-1">Extended by</h4>
439
+ <ul>
440
+ <li><a href="#thenablereference"><code>ThenableReference</code></a></li>
441
+ </ul>
442
+ <h4 id="properties-4">Properties</h4>
443
+ <div class="table-scroll">
444
+
445
+
446
+
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+
478
+ <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="query_symbol"></a> <code>[QUERY_SYMBOL]</code></td><td align="left"><code>readonly</code></td><td align="left"><code>true</code></td></tr><tr><td align="left"><a id="key-1"></a> <code>key</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><a id="parent"></a> <code>parent</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><a id="ref-1"></a> <code>ref</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><a id="root"></a> <code>root</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr></tbody></table></div>
479
+ <h4 id="methods-3">Methods</h4>
480
+ <p><a id="isequal"></a></p>
481
+ <h5 id="isequal">isEqual()</h5>
482
+ <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">Query</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
483
+ <h6 id="parameters-10">Parameters</h6>
484
+ <div class="table-scroll">
485
+
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+
497
+ <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="#query"><code>Query</code></a></td></tr></tbody></table></div>
498
+ <h6 id="returns-21">Returns</h6>
499
+ <p><code>boolean</code></p>
500
+ <h6 id="inherited-from">Inherited from</h6>
501
+ <p><a href="#query"><code>Query</code></a>.<a href="#isequal-2"><code>isEqual</code></a></p>
502
+ <p><a id="tojson-4"></a></p>
503
+ <h5 id="tojson-2">toJSON()</h5>
504
+ <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">string</span><span style="color:#ABB2BF">;</span></span></code></pre>
505
+ <h6 id="returns-22">Returns</h6>
506
+ <p><code>string</code></p>
507
+ <h6 id="inherited-from-1">Inherited from</h6>
508
+ <p><a href="#query"><code>Query</code></a>.<a href="#tojson-10"><code>toJSON</code></a></p>
509
+ <p><a id="tostring"></a></p>
510
+ <h5 id="tostring">toString()</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">toString</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">;</span></span></code></pre>
512
+ <h6 id="returns-23">Returns</h6>
513
+ <p><code>string</code></p>
514
+ <h6 id="inherited-from-2">Inherited from</h6>
515
+ <p><a href="#query"><code>Query</code></a>.<a href="#tostring-2"><code>toString</code></a></p>
516
+ <hr>
517
+ <p><a id="datasnapshotimplementation"></a></p>
518
+ <h3 id="datasnapshotimplementation">DataSnapshotImplementation</h3>
519
+ <h4 id="properties-5">Properties</h4>
520
+ <div class="table-scroll">
521
+
522
+
523
+
524
+
525
+
526
+
527
+
528
+
529
+
530
+
531
+
532
+
533
+
534
+
535
+
536
+
537
+
538
+
539
+
540
+
541
+
542
+
543
+
544
+
545
+
546
+
547
+
548
+
549
+
550
+ <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="key-2"></a> <code>key</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><a id="priority-1"></a> <code>priority</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code> | <code>number</code></td></tr><tr><td align="left"><a id="ref-2"></a> <code>ref</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><a id="size-1"></a> <code>size</code></td><td align="left"><code>readonly</code></td><td align="left"><code>number</code></td></tr></tbody></table></div>
551
+ <h4 id="methods-4">Methods</h4>
552
+ <p><a id="child-2"></a></p>
553
+ <h5 id="child-1">child()</h5>
554
+ <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">child</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">DataSnapshot</span><span style="color:#ABB2BF">;</span></span></code></pre>
555
+ <h6 id="parameters-11">Parameters</h6>
556
+ <div class="table-scroll">
557
+
558
+
559
+
560
+
561
+
562
+
563
+
564
+
565
+
566
+
567
+
568
+
569
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
570
+ <h6 id="returns-24">Returns</h6>
571
+ <p><a href="#datasnapshot"><code>DataSnapshot</code></a></p>
572
+ <p><a id="exists-2"></a></p>
573
+ <h5 id="exists-1">exists()</h5>
574
+ <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">exists</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
575
+ <h6 id="returns-25">Returns</h6>
576
+ <p><code>boolean</code></p>
577
+ <p><a id="exportval-2"></a></p>
578
+ <h5 id="exportval-1">exportVal()</h5>
579
+ <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">exportVal</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">JsonValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
580
+ <h6 id="returns-26">Returns</h6>
581
+ <p><a href="#jsonvalue"><code>JsonValue</code></a></p>
582
+ <p><a id="foreach-2"></a></p>
583
+ <h5 id="foreach-1">forEach()</h5>
584
+ <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">forEach</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">cb</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">child</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DataSnapshot</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E06C75"> boolean</span><span style="color:#56B6C2"> |</span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
585
+ <h6 id="parameters-12">Parameters</h6>
586
+ <div class="table-scroll">
587
+
588
+
589
+
590
+
591
+
592
+
593
+
594
+
595
+
596
+
597
+
598
+
599
+ <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>child</code>: <a href="#datasnapshot"><code>DataSnapshot</code></a>) => <code>boolean</code> | <code>void</code></td></tr></tbody></table></div>
600
+ <h6 id="returns-27">Returns</h6>
601
+ <p><code>boolean</code></p>
602
+ <p><a id="haschild-2"></a></p>
603
+ <h5 id="haschild-1">hasChild()</h5>
604
+ <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">hasChild</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
605
+ <h6 id="parameters-13">Parameters</h6>
606
+ <div class="table-scroll">
607
+
608
+
609
+
610
+
611
+
612
+
613
+
614
+
615
+
616
+
617
+
618
+
619
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
620
+ <h6 id="returns-28">Returns</h6>
621
+ <p><code>boolean</code></p>
622
+ <p><a id="haschildren-2"></a></p>
623
+ <h5 id="haschildren-1">hasChildren()</h5>
624
+ <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">hasChildren</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
625
+ <h6 id="returns-29">Returns</h6>
626
+ <p><code>boolean</code></p>
627
+ <p><a id="tojson-6"></a></p>
628
+ <h5 id="tojson-3">toJSON()</h5>
629
+ <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">JsonValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
630
+ <h6 id="returns-30">Returns</h6>
631
+ <p><a href="#jsonvalue"><code>JsonValue</code></a></p>
632
+ <p><a id="val-2"></a></p>
633
+ <h5 id="val-1">val()</h5>
634
+ <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">val</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">JsonValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
635
+ <h6 id="returns-31">Returns</h6>
636
+ <p><a href="#jsonvalue"><code>JsonValue</code></a></p>
637
+ <hr>
638
+ <p><a id="iterateddatasnapshot"></a></p>
639
+ <h3 id="iterateddatasnapshot">IteratedDataSnapshot</h3>
640
+ <p>Child snapshot supplied during ordered iteration; its key is never null.</p>
641
+ <h4 id="extends-1">Extends</h4>
642
+ <ul>
643
+ <li><a href="#datasnapshot"><code>DataSnapshot</code></a></li>
644
+ </ul>
645
+ <h4 id="properties-6">Properties</h4>
646
+ <div class="table-scroll">
647
+
648
+
649
+
650
+
651
+
652
+
653
+
654
+
655
+
656
+
657
+
658
+
659
+
660
+
661
+
662
+
663
+
664
+
665
+
666
+
667
+
668
+
669
+ <table><thead><tr><th align="left">Property</th><th align="left">Modifier</th><th align="left">Type</th><th align="left">Overrides</th></tr></thead><tbody><tr><td align="left"><a id="key-3"></a> <code>key</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td><td align="left"><a href="#datasnapshot"><code>DataSnapshot</code></a>.<a href="#key"><code>key</code></a></td></tr><tr><td align="left"><a id="ref-3"></a> <code>ref</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td><td align="left">-</td></tr></tbody></table></div>
670
+ <h4 id="accessors-1">Accessors</h4>
671
+ <p><a id="priority-2"></a></p>
672
+ <h5 id="priority-1">priority</h5>
673
+ <h6 id="get-signature-3">Get Signature</h6>
674
+ <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"> priority</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">string</span><span style="color:#56B6C2"> |</span><span style="color:#E06C75"> number</span><span style="color:#ABB2BF">;</span></span></code></pre>
675
+ <h6 id="returns-32">Returns</h6>
676
+ <p><code>string</code> | <code>number</code></p>
677
+ <h6 id="inherited-from-3">Inherited from</h6>
678
+ <p><a href="#datasnapshot"><code>DataSnapshot</code></a>.<a href="#priority"><code>priority</code></a></p>
679
+ <p><a id="size-2"></a></p>
680
+ <h5 id="size-1">size</h5>
681
+ <h6 id="get-signature-4">Get Signature</h6>
682
+ <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"> size</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">number</span><span style="color:#ABB2BF">;</span></span></code></pre>
683
+ <h6 id="returns-33">Returns</h6>
684
+ <p><code>number</code></p>
685
+ <h6 id="inherited-from-4">Inherited from</h6>
686
+ <p><a href="#datasnapshot"><code>DataSnapshot</code></a>.<a href="#size"><code>size</code></a></p>
687
+ <h4 id="methods-5">Methods</h4>
688
+ <p><a id="child-4"></a></p>
689
+ <h5 id="child-2">child()</h5>
690
+ <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">child</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">DataSnapshot</span><span style="color:#ABB2BF">;</span></span></code></pre>
691
+ <h6 id="parameters-14">Parameters</h6>
692
+ <div class="table-scroll">
693
+
694
+
695
+
696
+
697
+
698
+
699
+
700
+
701
+
702
+
703
+
704
+
705
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
706
+ <h6 id="returns-34">Returns</h6>
707
+ <p><a href="#datasnapshot"><code>DataSnapshot</code></a></p>
708
+ <h6 id="inherited-from-5">Inherited from</h6>
709
+ <p><a href="#datasnapshot"><code>DataSnapshot</code></a>.<a href="#child"><code>child</code></a></p>
710
+ <p><a id="exists-4"></a></p>
711
+ <h5 id="exists-2">exists()</h5>
712
+ <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">exists</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
713
+ <h6 id="returns-35">Returns</h6>
714
+ <p><code>boolean</code></p>
715
+ <h6 id="inherited-from-6">Inherited from</h6>
716
+ <p><a href="#datasnapshot"><code>DataSnapshot</code></a>.<a href="#exists"><code>exists</code></a></p>
717
+ <p><a id="exportval-4"></a></p>
718
+ <h5 id="exportval-2">exportVal()</h5>
719
+ <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">exportVal</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">JsonValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
720
+ <h6 id="returns-36">Returns</h6>
721
+ <p><a href="#jsonvalue"><code>JsonValue</code></a></p>
722
+ <h6 id="inherited-from-7">Inherited from</h6>
723
+ <p><a href="#datasnapshot"><code>DataSnapshot</code></a>.<a href="#exportval"><code>exportVal</code></a></p>
724
+ <p><a id="foreach-4"></a></p>
725
+ <h5 id="foreach-2">forEach()</h5>
726
+ <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">forEach</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">cb</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">child</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DataSnapshot</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E06C75"> boolean</span><span style="color:#56B6C2"> |</span><span style="color:#C678DD"> void</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
727
+ <h6 id="parameters-15">Parameters</h6>
728
+ <div class="table-scroll">
729
+
730
+
731
+
732
+
733
+
734
+
735
+
736
+
737
+
738
+
739
+
740
+
741
+ <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>child</code>: <a href="#datasnapshot"><code>DataSnapshot</code></a>) => <code>boolean</code> | <code>void</code></td></tr></tbody></table></div>
742
+ <h6 id="returns-37">Returns</h6>
743
+ <p><code>boolean</code></p>
744
+ <h6 id="inherited-from-8">Inherited from</h6>
745
+ <p><a href="#datasnapshot"><code>DataSnapshot</code></a>.<a href="#foreach"><code>forEach</code></a></p>
746
+ <p><a id="haschild-4"></a></p>
747
+ <h5 id="haschild-2">hasChild()</h5>
748
+ <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">hasChild</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">path</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
749
+ <h6 id="parameters-16">Parameters</h6>
750
+ <div class="table-scroll">
751
+
752
+
753
+
754
+
755
+
756
+
757
+
758
+
759
+
760
+
761
+
762
+
763
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
764
+ <h6 id="returns-38">Returns</h6>
765
+ <p><code>boolean</code></p>
766
+ <h6 id="inherited-from-9">Inherited from</h6>
767
+ <p><a href="#datasnapshot"><code>DataSnapshot</code></a>.<a href="#haschild"><code>hasChild</code></a></p>
768
+ <p><a id="haschildren-4"></a></p>
769
+ <h5 id="haschildren-2">hasChildren()</h5>
770
+ <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">hasChildren</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
771
+ <h6 id="returns-39">Returns</h6>
772
+ <p><code>boolean</code></p>
773
+ <h6 id="inherited-from-10">Inherited from</h6>
774
+ <p><a href="#datasnapshot"><code>DataSnapshot</code></a>.<a href="#haschildren"><code>hasChildren</code></a></p>
775
+ <p><a id="tojson-8"></a></p>
776
+ <h5 id="tojson-4">toJSON()</h5>
777
+ <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">JsonValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
778
+ <h6 id="returns-40">Returns</h6>
779
+ <p><a href="#jsonvalue"><code>JsonValue</code></a></p>
780
+ <h6 id="inherited-from-11">Inherited from</h6>
781
+ <p><a href="#datasnapshot"><code>DataSnapshot</code></a>.<a href="#tojson"><code>toJSON</code></a></p>
782
+ <p><a id="val-4"></a></p>
783
+ <h5 id="val-2">val()</h5>
784
+ <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">val</span><span style="color:#ABB2BF">(): </span><span style="color:#E06C75">JsonValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
785
+ <h6 id="returns-41">Returns</h6>
786
+ <p><a href="#jsonvalue"><code>JsonValue</code></a></p>
787
+ <h6 id="inherited-from-12">Inherited from</h6>
788
+ <p><a href="#datasnapshot"><code>DataSnapshot</code></a>.<a href="#val"><code>val</code></a></p>
789
+ <hr>
790
+ <p><a id="listenoptions"></a></p>
791
+ <h3 id="listenoptions">ListenOptions</h3>
792
+ <h4 id="properties-7">Properties</h4>
793
+ <div class="table-scroll">
794
+
795
+
796
+
797
+
798
+
799
+
800
+
801
+
802
+
803
+
804
+
805
+
806
+
807
+
808
+ <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="onlyonce"></a> <code>onlyOnce?</code></td><td align="left"><code>readonly</code></td><td align="left"><code>boolean</code></td></tr></tbody></table></div>
809
+ <hr>
810
+ <p><a id="query"></a></p>
811
+ <h3 id="query">Query</h3>
812
+ <p>RTDB-shaped reference. Backend-opaque to consumers; mirrors
813
+ <code>firebase/database</code>’s <code>DatabaseReference</code> for the subset of methods
814
+ the modular SDK uses idiomatically as plain free-function args.</p>
815
+ <p><code>key</code> is the last path segment (matches <code>DatabaseReference.key</code>).
816
+ <code>null</code> for the root ref. <code>parent</code> is the ref one segment up
817
+ (<code>null</code> at root). <code>root</code> is always the root ref.</p>
818
+ <p><code>toString()</code> returns a stable <code>sandbox://</code> URL.</p>
819
+ <h4 id="extended-by-2">Extended by</h4>
820
+ <ul>
821
+ <li><a href="#databasereference"><code>DatabaseReference</code></a></li>
822
+ </ul>
823
+ <h4 id="properties-8">Properties</h4>
824
+ <div class="table-scroll">
825
+
826
+
827
+
828
+
829
+
830
+
831
+
832
+
833
+
834
+
835
+
836
+
837
+
838
+
839
+
840
+
841
+
842
+
843
+
844
+ <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="query_symbol-1"></a> <code>[QUERY_SYMBOL]</code></td><td align="left"><code>readonly</code></td><td align="left"><code>true</code></td></tr><tr><td align="left"><a id="ref-4"></a> <code>ref</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr></tbody></table></div>
845
+ <h4 id="methods-6">Methods</h4>
846
+ <p><a id="isequal-2"></a></p>
847
+ <h5 id="isequal-1">isEqual()</h5>
848
+ <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">Query</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
849
+ <h6 id="parameters-17">Parameters</h6>
850
+ <div class="table-scroll">
851
+
852
+
853
+
854
+
855
+
856
+
857
+
858
+
859
+
860
+
861
+
862
+
863
+ <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="#query"><code>Query</code></a></td></tr></tbody></table></div>
864
+ <h6 id="returns-42">Returns</h6>
865
+ <p><code>boolean</code></p>
866
+ <p><a id="tojson-10"></a></p>
867
+ <h5 id="tojson-5">toJSON()</h5>
868
+ <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">string</span><span style="color:#ABB2BF">;</span></span></code></pre>
869
+ <h6 id="returns-43">Returns</h6>
870
+ <p><code>string</code></p>
871
+ <p><a id="tostring-2"></a></p>
872
+ <h5 id="tostring-1">toString()</h5>
873
+ <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>
874
+ <h6 id="returns-44">Returns</h6>
875
+ <p><code>string</code></p>
876
+ <hr>
877
+ <p><a id="thenablereference"></a></p>
878
+ <h3 id="thenablereference">ThenableReference</h3>
879
+ <p>The return type of <a href="#push">push</a> — a regular <a href="#databasereference">DatabaseReference</a>
880
+ with <code>.then</code> / <code>.catch</code> attached so it can be <code>await</code>ed. Mirrors
881
+ <code>firebase/database</code>’s <code>ThenableReference</code> (<code>api/Reference_impl.ts:569</code>).</p>
882
+ <p>Critical (DB-B7): the ref + its <code>.key</code> are available SYNCHRONOUSLY —
883
+ the key is minted client-side. The promise covers only the optional
884
+ value write; a rules-denied write rejects the promise (it does NOT
885
+ throw synchronously and lose the key). Oracle:
886
+ <code>rtdb-push-autoid-format.json</code>.</p>
887
+ <h4 id="extends-2">Extends</h4>
888
+ <ul>
889
+ <li><a href="#databasereference"><code>DatabaseReference</code></a></li>
890
+ </ul>
891
+ <h4 id="properties-9">Properties</h4>
892
+ <div class="table-scroll">
893
+
894
+
895
+
896
+
897
+
898
+
899
+
900
+
901
+
902
+
903
+
904
+
905
+
906
+
907
+
908
+
909
+
910
+
911
+
912
+
913
+
914
+
915
+
916
+
917
+
918
+
919
+
920
+
921
+
922
+
923
+
924
+
925
+
926
+
927
+ <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="query_symbol-2"></a> <code>[QUERY_SYMBOL]</code></td><td align="left"><code>readonly</code></td><td align="left"><code>true</code></td></tr><tr><td align="left"><a id="key-4"></a> <code>key</code></td><td align="left"><code>readonly</code></td><td align="left"><code>string</code></td></tr><tr><td align="left"><a id="parent-1"></a> <code>parent</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><a id="ref-5"></a> <code>ref</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><a id="root-1"></a> <code>root</code></td><td align="left"><code>readonly</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr></tbody></table></div>
928
+ <h4 id="methods-7">Methods</h4>
929
+ <p><a id="catch"></a></p>
930
+ <h5 id="catch">catch()</h5>
931
+ <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">catch</span><span style="color:#56B6C2">&#x3C;</span><span style="color:#E06C75">TResult</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">onrejected</span><span style="color:#C678DD">?:</span><span style="color:#ABB2BF"> (</span><span style="color:#E06C75;font-style:italic">reason</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:#E06C75"> TResult</span><span style="color:#56B6C2"> |</span><span style="color:#E06C75"> PromiseLike</span><span style="color:#56B6C2">&#x3C;</span><span style="color:#E06C75">TResult</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2">&#x3C;</span><span style="color:#E06C75">DatabaseReference</span><span style="color:#56B6C2"> |</span><span style="color:#E06C75"> TResult</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
932
+ <h6 id="type-parameters">Type Parameters</h6>
933
+ <div class="table-scroll">
934
+
935
+
936
+
937
+
938
+
939
+
940
+
941
+
942
+
943
+
944
+
945
+
946
+ <table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>TResult</code></td><td align="left"><code>never</code></td></tr></tbody></table></div>
947
+ <h6 id="parameters-18">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>onrejected?</code></td><td align="left">(<code>reason</code>: <code>unknown</code>) => <code>TResult</code> | <code>PromiseLike</code>&#x3C;<code>TResult</code>></td></tr></tbody></table></div>
962
+ <h6 id="returns-45">Returns</h6>
963
+ <p><code>Promise</code>&#x3C;<a href="#databasereference"><code>DatabaseReference</code></a> | <code>TResult</code>></p>
964
+ <p><a id="isequal-4"></a></p>
965
+ <h5 id="isequal-2">isEqual()</h5>
966
+ <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">Query</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">boolean</span><span style="color:#ABB2BF">;</span></span></code></pre>
967
+ <h6 id="parameters-19">Parameters</h6>
968
+ <div class="table-scroll">
969
+
970
+
971
+
972
+
973
+
974
+
975
+
976
+
977
+
978
+
979
+
980
+
981
+ <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="#query"><code>Query</code></a></td></tr></tbody></table></div>
982
+ <h6 id="returns-46">Returns</h6>
983
+ <p><code>boolean</code></p>
984
+ <h6 id="inherited-from-13">Inherited from</h6>
985
+ <p><a href="#databasereference"><code>DatabaseReference</code></a>.<a href="#isequal"><code>isEqual</code></a></p>
986
+ <p><a id="then"></a></p>
987
+ <h5 id="then">then()</h5>
988
+ <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">then</span><span style="color:#ABB2BF">&#x3C;</span><span style="color:#E5C07B">TResult1</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">TResult2</span><span style="color:#ABB2BF">>(</span><span style="color:#E06C75">onfulfilled</span><span style="color:#C678DD">?:</span><span style="color:#ABB2BF"> (</span><span style="color:#E06C75;font-style:italic">value</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E06C75"> TResult1</span><span style="color:#56B6C2"> |</span><span style="color:#E06C75"> PromiseLike</span><span style="color:#56B6C2">&#x3C;</span><span style="color:#E06C75">TResult1</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">onrejected</span><span style="color:#C678DD">?:</span><span style="color:#ABB2BF"> (</span><span style="color:#E06C75;font-style:italic">reason</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:#E06C75"> TResult2</span><span style="color:#56B6C2"> |</span><span style="color:#E06C75"> PromiseLike</span><span style="color:#56B6C2">&#x3C;</span><span style="color:#E06C75">TResult2</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#56B6C2">&#x3C;</span><span style="color:#E06C75">TResult1</span><span style="color:#56B6C2"> |</span><span style="color:#E06C75"> TResult2</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">;</span></span></code></pre>
989
+ <h6 id="type-parameters-1">Type Parameters</h6>
990
+ <div class="table-scroll">
991
+
992
+
993
+
994
+
995
+
996
+
997
+
998
+
999
+
1000
+
1001
+
1002
+
1003
+
1004
+
1005
+
1006
+
1007
+ <table><thead><tr><th align="left">Type Parameter</th><th align="left">Default type</th></tr></thead><tbody><tr><td align="left"><code>TResult1</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><code>TResult2</code></td><td align="left"><code>never</code></td></tr></tbody></table></div>
1008
+ <h6 id="parameters-20">Parameters</h6>
1009
+ <div class="table-scroll">
1010
+
1011
+
1012
+
1013
+
1014
+
1015
+
1016
+
1017
+
1018
+
1019
+
1020
+
1021
+
1022
+
1023
+
1024
+
1025
+
1026
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>onfulfilled?</code></td><td align="left">(<code>value</code>: <a href="#databasereference"><code>DatabaseReference</code></a>) => <code>TResult1</code> | <code>PromiseLike</code>&#x3C;<code>TResult1</code>></td></tr><tr><td align="left"><code>onrejected?</code></td><td align="left">(<code>reason</code>: <code>unknown</code>) => <code>TResult2</code> | <code>PromiseLike</code>&#x3C;<code>TResult2</code>></td></tr></tbody></table></div>
1027
+ <h6 id="returns-47">Returns</h6>
1028
+ <p><code>Promise</code>&#x3C;<code>TResult1</code> | <code>TResult2</code>></p>
1029
+ <p><a id="tojson-12"></a></p>
1030
+ <h5 id="tojson-6">toJSON()</h5>
1031
+ <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">string</span><span style="color:#ABB2BF">;</span></span></code></pre>
1032
+ <h6 id="returns-48">Returns</h6>
1033
+ <p><code>string</code></p>
1034
+ <h6 id="inherited-from-14">Inherited from</h6>
1035
+ <p><a href="#databasereference"><code>DatabaseReference</code></a>.<a href="#tojson-4"><code>toJSON</code></a></p>
1036
+ <p><a id="tostring-4"></a></p>
1037
+ <h5 id="tostring-2">toString()</h5>
1038
+ <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>
1039
+ <h6 id="returns-49">Returns</h6>
1040
+ <p><code>string</code></p>
1041
+ <h6 id="inherited-from-15">Inherited from</h6>
1042
+ <p><a href="#databasereference"><code>DatabaseReference</code></a>.<a href="#tostring"><code>toString</code></a></p>
1043
+ <hr>
1044
+ <p><a id="transactionoptions"></a></p>
1045
+ <h3 id="transactionoptions">TransactionOptions</h3>
1046
+ <h4 id="properties-10">Properties</h4>
1047
+ <div class="table-scroll">
1048
+
1049
+
1050
+
1051
+
1052
+
1053
+
1054
+
1055
+
1056
+
1057
+
1058
+
1059
+
1060
+
1061
+
1062
+ <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="applylocally"></a> <code>applyLocally?</code></td><td align="left"><code>readonly</code></td><td align="left"><code>boolean</code></td></tr></tbody></table></div>
1063
+ <h2 id="type-aliases">Type Aliases</h2>
1064
+ <p><a id="appdatabase"></a></p>
1065
+ <h3 id="appdatabase">AppDatabase</h3>
1066
+ <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"> AppDatabase</span><span style="color:#56B6C2"> =</span><span style="color:#E5C07B"> Database</span><span style="color:#ABB2BF"> &#x26; {</span></span>
1067
+ <span class="line"><span style="color:#E06C75"> app</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">FirebaseApp</span><span style="color:#ABB2BF">;</span></span>
1068
+ <span class="line"><span style="color:#ABB2BF">};</span></span></code></pre>
1069
+ <p>Database handle returned by Firebase-shaped app overloads.</p>
1070
+ <h4 id="type-declaration">Type Declaration</h4>
1071
+ <h5 id="app">app</h5>
1072
+ <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">readonly</span><span style="color:#E06C75"> app</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">FirebaseApp</span><span style="color:#ABB2BF">;</span></span></code></pre>
1073
+ <hr>
1074
+ <p><a id="emulatormocktokenoptions"></a></p>
1075
+ <h3 id="emulatormocktokenoptions">EmulatorMockTokenOptions</h3>
1076
+ <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"> EmulatorMockTokenOptions</span><span style="color:#56B6C2"> =</span></span>
1077
+ <span class="line"><span style="color:#ABB2BF"> | {</span></span>
1078
+ <span class="line"><span style="color:#E06C75"> user_id</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">;</span></span>
1079
+ <span class="line"><span style="color:#ABB2BF">}</span></span>
1080
+ <span class="line"><span style="color:#ABB2BF"> | {</span></span>
1081
+ <span class="line"><span style="color:#E06C75"> sub</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">;</span></span>
1082
+ <span class="line"><span style="color:#ABB2BF">} &#x26; </span><span style="color:#E5C07B">Partial</span><span style="color:#ABB2BF">&#x3C;</span><span style="color:#E5C07B">FirebaseIdTokenShape</span><span style="color:#ABB2BF">>;</span></span></code></pre>
1083
+ <hr>
1084
+ <p><a id="eventtype"></a></p>
1085
+ <h3 id="eventtype">EventType</h3>
1086
+ <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"> EventType</span><span style="color:#56B6C2"> =</span></span>
1087
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"value"</span></span>
1088
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"child_added"</span></span>
1089
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"child_changed"</span></span>
1090
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"child_moved"</span></span>
1091
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"child_removed"</span><span style="color:#ABB2BF">;</span></span></code></pre>
1092
+ <hr>
1093
+ <p><a id="jsonvalue"></a></p>
1094
+ <h3 id="jsonvalue">JsonValue</h3>
1095
+ <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"> JsonValue</span><span style="color:#56B6C2"> =</span></span>
1096
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">null</span></span>
1097
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">boolean</span></span>
1098
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">number</span></span>
1099
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">string</span></span>
1100
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">JsonValue</span><span style="color:#ABB2BF">[]</span></span>
1101
+ <span class="line"><span style="color:#ABB2BF"> | {</span></span>
1102
+ <span class="line"><span style="color:#ABB2BF">[</span><span style="color:#E06C75;font-style:italic">key</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">]: </span><span style="color:#E5C07B">JsonValue</span><span style="color:#ABB2BF">;</span></span>
1103
+ <span class="line"><span style="color:#ABB2BF">};</span></span></code></pre>
1104
+ <p>RTDB-shaped in-memory JSON tree.</p>
1105
+ <p>The data layer for the modular SDK’s sandbox target. RTDB stores a
1106
+ single nested JSON tree; reads name a path and walk; writes either
1107
+ replace a subtree (<code>set</code>) or merge top-level keys (<code>update</code>).</p>
1108
+ <p>Path semantics (matches <code>firebase/database</code>):</p>
1109
+ <ul>
1110
+ <li><code>'/'</code> is the root.</li>
1111
+ <li>Leading + trailing slashes are stripped; empty segments are
1112
+ ignored.</li>
1113
+ <li><code>null</code> at any level erases that subtree. Locked by oracle
1114
+ observation
1115
+ <code>packages/conformance/observations/rtdb/rtdb-remove-vs-set-null.json</code> which
1116
+ says <code>set(ref, null)</code> and <code>remove(ref)</code> produce equivalent end
1117
+ states.</li>
1118
+ <li>A read of an absent path returns <code>null</code> (NOT an error). Matches
1119
+ the <code>DataSnapshot.val()</code> contract.</li>
1120
+ </ul>
1121
+ <p>Trimming: when a write or delete leaves a sibling-less empty branch,
1122
+ the empty branch is removed. RTDB’s documented invariant: “Empty
1123
+ nodes don’t exist”. The crawl + listener layers count on this so
1124
+ <code>exists()</code> and <code>hasChildren()</code> match prod.</p>
1125
+ <p>This module is identity-agnostic — rules evaluation happens in
1126
+ <code>local-environment.ts</code>. The tree just stores bytes.</p>
1127
+ <hr>
1128
+ <p><a id="queryconstrainttype-1"></a></p>
1129
+ <h3 id="queryconstrainttype">QueryConstraintType</h3>
1130
+ <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"> QueryConstraintType</span><span style="color:#56B6C2"> =</span></span>
1131
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"orderByChild"</span></span>
1132
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"orderByKey"</span></span>
1133
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"orderByPriority"</span></span>
1134
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"orderByValue"</span></span>
1135
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"startAt"</span></span>
1136
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"startAfter"</span></span>
1137
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"endAt"</span></span>
1138
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"endBefore"</span></span>
1139
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"equalTo"</span></span>
1140
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"limitToFirst"</span></span>
1141
+ <span class="line"><span style="color:#ABB2BF"> | </span><span style="color:#98C379">"limitToLast"</span><span style="color:#ABB2BF">;</span></span></code></pre>
1142
+ <hr>
1143
+ <p><a id="unsubscribe"></a></p>
1144
+ <h3 id="unsubscribe">Unsubscribe()</h3>
1145
+ <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>
1146
+ <h4 id="returns-50">Returns</h4>
1147
+ <p><code>void</code></p>
1148
+ <h2 id="variables">Variables</h2>
1149
+ <p><a id="constraint_symbol-1"></a></p>
1150
+ <h3 id="constraint_symbol">CONSTRAINT_SYMBOL</h3>
1151
+ <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"> CONSTRAINT_SYMBOL</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unique</span><span style="color:#E5C07B"> symbol</span><span style="color:#ABB2BF">;</span></span></code></pre>
1152
+ <p>Hidden brand on every QueryConstraint.</p>
1153
+ <hr>
1154
+ <p><a id="query_symbol-3"></a></p>
1155
+ <h3 id="query_symbol">QUERY_SYMBOL</h3>
1156
+ <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"> QUERY_SYMBOL</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unique</span><span style="color:#E5C07B"> symbol</span><span style="color:#ABB2BF">;</span></span></code></pre>
1157
+ <p>Hidden brand on every Query.</p>
1158
+ <hr>
1159
+ <p><a id="sandbox"></a></p>
1160
+ <h3 id="sandbox">sandbox</h3>
1161
+ <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:#ABB2BF">: {</span></span>
1162
+ <span class="line"><span style="color:#E06C75"> setData</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span>
1163
+ <span class="line"><span style="color:#E06C75"> setRules</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span>
1164
+ <span class="line"><span style="color:#E06C75"> snapshotState</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">JsonValue</span><span style="color:#ABB2BF">;</span></span>
1165
+ <span class="line"><span style="color:#ABB2BF">};</span></span></code></pre>
1166
+ <h4 id="type-declaration-1">Type Declaration</h4>
1167
+ <p><a id="setdata"></a></p>
1168
+ <h5 id="setdata">setData()</h5>
1169
+ <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">setData</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">db</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">Database</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">data</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">Record</span><span style="color:#56B6C2">&#x3C;</span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">unknown</span><span style="color:#56B6C2">></span><span style="color:#ABB2BF">): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
1170
+ <p>Bulk-load data bypassing rules. The supplied map’s keys are
1171
+ absolute paths (<code>'/users/alice'</code>) and the values land at those
1172
+ paths. Convenient for test fixtures.</p>
1173
+ <h6 id="parameters-21">Parameters</h6>
1174
+ <div class="table-scroll">
1175
+
1176
+
1177
+
1178
+
1179
+
1180
+
1181
+
1182
+
1183
+
1184
+
1185
+
1186
+
1187
+
1188
+
1189
+
1190
+
1191
+ <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="#database"><code>Database</code></a></td></tr><tr><td align="left"><code>data</code></td><td align="left"><code>Record</code>&#x3C;<code>string</code>, <code>unknown</code>></td></tr></tbody></table></div>
1192
+ <h6 id="returns-51">Returns</h6>
1193
+ <p><code>void</code></p>
1194
+ <p><a id="setrules"></a></p>
1195
+ <h5 id="setrules">setRules()</h5>
1196
+ <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">setRules</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">db</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">Database</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">rulesJson</span><span style="color:#ABB2BF">: {</span></span>
1197
+ <span class="line"><span style="color:#E06C75"> rules</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">Record</span><span style="color:#56B6C2">&#x3C;</span><span style="color:#E06C75">string</span><span style="color:#ABB2BF">, unknown>;</span></span>
1198
+ <span class="line"><span style="color:#ABB2BF">}): </span><span style="color:#C678DD">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
1199
+ <p>Replace deployed rules. Pass <code>null</code> to clear (sandbox returns to
1200
+ default-allow). Rules are evaluated through the existing
1201
+ RTDB rules simulator — the same engine used by the rules tooling.</p>
1202
+ <h6 id="parameters-22">Parameters</h6>
1203
+ <div class="table-scroll">
1204
+
1205
+
1206
+
1207
+
1208
+
1209
+
1210
+
1211
+
1212
+
1213
+
1214
+
1215
+
1216
+
1217
+
1218
+
1219
+
1220
+
1221
+
1222
+
1223
+
1224
+ <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="#database"><code>Database</code></a></td></tr><tr><td align="left"><code>rulesJson</code></td><td align="left">{ <code>rules</code>: <code>Record</code>&#x3C;<code>string</code>, <code>unknown</code>>; }</td></tr><tr><td align="left"><code>rulesJson.rules</code></td><td align="left"><code>Record</code>&#x3C;<code>string</code>, <code>unknown</code>></td></tr></tbody></table></div>
1225
+ <h6 id="returns-52">Returns</h6>
1226
+ <p><code>void</code></p>
1227
+ <h6 id="example">Example</h6>
1228
+ <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">sandbox</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">setRules</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">db</span><span style="color:#ABB2BF">, {</span></span>
1229
+ <span class="line"><span style="color:#E06C75"> rules</span><span style="color:#ABB2BF">: {</span></span>
1230
+ <span class="line"><span style="color:#98C379"> '.read'</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">'auth != null'</span><span style="color:#ABB2BF">,</span></span>
1231
+ <span class="line"><span style="color:#98C379"> '.write'</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">'auth != null'</span><span style="color:#ABB2BF">,</span></span>
1232
+ <span class="line"><span style="color:#ABB2BF"> },</span></span>
1233
+ <span class="line"><span style="color:#ABB2BF">});</span></span></code></pre>
1234
+ <p><a id="snapshotstate"></a></p>
1235
+ <h5 id="snapshotstate">snapshotState()</h5>
1236
+ <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">snapshotState</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">db</span><span style="color:#ABB2BF">: </span><span style="color:#E06C75">Database</span><span style="color:#ABB2BF">): </span><span style="color:#E06C75">JsonValue</span><span style="color:#ABB2BF">;</span></span></code></pre>
1237
+ <p>Snapshot the full sandbox tree (rule-bypass read). Usually a keyed
1238
+ object; may be a primitive when the root holds one (DB-B13).</p>
1239
+ <h6 id="parameters-23">Parameters</h6>
1240
+ <div class="table-scroll">
1241
+
1242
+
1243
+
1244
+
1245
+
1246
+
1247
+
1248
+
1249
+
1250
+
1251
+
1252
+
1253
+ <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="#database"><code>Database</code></a></td></tr></tbody></table></div>
1254
+ <h6 id="returns-53">Returns</h6>
1255
+ <p><a href="#jsonvalue"><code>JsonValue</code></a></p>
1256
+ <hr>
1257
+ <p><a id="target_symbol-1"></a></p>
1258
+ <h3 id="target_symbol">TARGET_SYMBOL</h3>
1259
+ <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"> TARGET_SYMBOL</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unique</span><span style="color:#E5C07B"> symbol</span><span style="color:#ABB2BF">;</span></span></code></pre>
1260
+ <p>Hidden brand on every <a href="#database">Database</a> handle.</p>
1261
+ <h2 id="functions">Functions</h2>
1262
+ <p><a id="buildsandboxref"></a></p>
1263
+ <h3 id="buildsandboxref">buildSandboxRef()</h3>
1264
+ <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"> buildSandboxRef</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">target</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">SandboxTarget</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">SandboxLiveTarget</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">path</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">;</span></span></code></pre>
1265
+ <p>Build a sandbox-backed <code>DatabaseReference</code>. Cached parent / root
1266
+ pointers are computed lazily so a long chain doesn’t materialise
1267
+ every intermediate ref upfront.</p>
1268
+ <h4 id="parameters-24">Parameters</h4>
1269
+ <div class="table-scroll">
1270
+
1271
+
1272
+
1273
+
1274
+
1275
+
1276
+
1277
+
1278
+
1279
+
1280
+
1281
+
1282
+
1283
+
1284
+
1285
+
1286
+ <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>SandboxTarget</code> | <code>SandboxLiveTarget</code></td></tr><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
1287
+ <h4 id="returns-54">Returns</h4>
1288
+ <p><a href="#databasereference"><code>DatabaseReference</code></a></p>
1289
+ <hr>
1290
+ <p><a id="child-6"></a></p>
1291
+ <h3 id="child-3">child()</h3>
1292
+ <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"> child</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">parent</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">path</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">;</span></span></code></pre>
1293
+ <p>Sub-path constructor. <code>child(ref, 'sub/path')</code> returns a ref at
1294
+ <code>&#x3C;ref>/sub/path</code>.</p>
1295
+ <p>Mirrors <code>firebase/database</code>’s <code>child(parent, path)</code> — leading +
1296
+ empty segments stripped; the result inherits the parent’s target.</p>
1297
+ <h4 id="parameters-25">Parameters</h4>
1298
+ <div class="table-scroll">
1299
+
1300
+
1301
+
1302
+
1303
+
1304
+
1305
+
1306
+
1307
+
1308
+
1309
+
1310
+
1311
+
1312
+
1313
+
1314
+
1315
+ <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="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
1316
+ <h4 id="returns-55">Returns</h4>
1317
+ <p><a href="#databasereference"><code>DatabaseReference</code></a></p>
1318
+ <hr>
1319
+ <p><a id="connectdatabaseemulator"></a></p>
1320
+ <h3 id="connectdatabaseemulator">connectDatabaseEmulator()</h3>
1321
+ <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"> connectDatabaseEmulator</span><span style="color:#ABB2BF">(</span></span>
1322
+ <span class="line"><span style="color:#E06C75;font-style:italic"> _db</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Database</span><span style="color:#ABB2BF">,</span></span>
1323
+ <span class="line"><span style="color:#E06C75;font-style:italic"> _host</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">,</span></span>
1324
+ <span class="line"><span style="color:#E06C75;font-style:italic"> _port</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">number</span><span style="color:#ABB2BF">,</span></span>
1325
+ <span class="line"><span style="color:#E06C75;font-style:italic"> _options</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: {</span></span>
1326
+ <span class="line"><span style="color:#E06C75"> mockUserToken</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">EmulatorMockTokenOptions</span><span style="color:#ABB2BF">;</span></span>
1327
+ <span class="line"><span style="color:#ABB2BF">}): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
1328
+ <p><code>connectDatabaseEmulator(db, host, port)</code> is an accepted no-op because the
1329
+ selected backend already is the local sandbox.</p>
1330
+ <h4 id="parameters-26">Parameters</h4>
1331
+ <div class="table-scroll">
1332
+
1333
+
1334
+
1335
+
1336
+
1337
+
1338
+
1339
+
1340
+
1341
+
1342
+
1343
+
1344
+
1345
+
1346
+
1347
+
1348
+
1349
+
1350
+
1351
+
1352
+
1353
+
1354
+
1355
+
1356
+
1357
+
1358
+
1359
+
1360
+ <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="#database"><code>Database</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> | <a href="#emulatormocktokenoptions"><code>EmulatorMockTokenOptions</code></a>; }</td></tr><tr><td align="left"><code>_options.mockUserToken?</code></td><td align="left"><code>string</code> | <a href="#emulatormocktokenoptions"><code>EmulatorMockTokenOptions</code></a></td></tr></tbody></table></div>
1361
+ <h4 id="returns-56">Returns</h4>
1362
+ <p><code>void</code></p>
1363
+ <hr>
1364
+ <p><a id="enablelogging"></a></p>
1365
+ <h3 id="enablelogging">enableLogging()</h3>
1366
+ <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"> enableLogging</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">logger</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">boolean</span><span style="color:#ABB2BF"> | (</span><span style="color:#E06C75;font-style:italic">message</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</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:#E06C75;font-style:italic">persistent</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">boolean</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
1367
+ <p><code>enableLogging(logger?, persistent?)</code> — toggle RTDB SDK logging.</p>
1368
+ <p>Accepted no-op: the sandbox has no modular-SDK-style logger to wire a
1369
+ level/sink into (it uses host-level <code>console</code> logging directly, gated
1370
+ by <code>pyric dev</code>’s own flags — matching <code>pyric/firestore</code>’s
1371
+ <code>setLogLevel</code>). Accepted so init code that calls it compiles + runs.</p>
1372
+ <h4 id="parameters-27">Parameters</h4>
1373
+ <div class="table-scroll">
1374
+
1375
+
1376
+
1377
+
1378
+
1379
+
1380
+
1381
+
1382
+
1383
+
1384
+
1385
+
1386
+
1387
+
1388
+
1389
+
1390
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>logger?</code></td><td align="left"><code>boolean</code> | (<code>message</code>: <code>string</code>) => <code>void</code></td></tr><tr><td align="left"><code>persistent?</code></td><td align="left"><code>boolean</code></td></tr></tbody></table></div>
1391
+ <h4 id="returns-57">Returns</h4>
1392
+ <p><code>void</code></p>
1393
+ <hr>
1394
+ <p><a id="endat"></a></p>
1395
+ <h3 id="endat">endAt()</h3>
1396
+ <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">value</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">JsonValue</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">key</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">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
1397
+ <p><code>endAt(value, key?)</code> — INCLUSIVE upper bound. Adjacent to startAt;
1398
+ same key tie-breaker semantics.</p>
1399
+ <h4 id="parameters-28">Parameters</h4>
1400
+ <div class="table-scroll">
1401
+
1402
+
1403
+
1404
+
1405
+
1406
+
1407
+
1408
+
1409
+
1410
+
1411
+
1412
+
1413
+
1414
+
1415
+
1416
+
1417
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>value</code></td><td align="left"><a href="#jsonvalue"><code>JsonValue</code></a></td></tr><tr><td align="left"><code>key?</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
1418
+ <h4 id="returns-58">Returns</h4>
1419
+ <p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
1420
+ <hr>
1421
+ <p><a id="endbefore"></a></p>
1422
+ <h3 id="endbefore">endBefore()</h3>
1423
+ <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">value</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">JsonValue</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">key</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">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
1424
+ <p><code>endBefore(value, key?)</code> — EXCLUSIVE upper bound. Locked by
1425
+ <code>rtdb-modular-startafter-endbefore-exclusive.json</code>.</p>
1426
+ <h4 id="parameters-29">Parameters</h4>
1427
+ <div class="table-scroll">
1428
+
1429
+
1430
+
1431
+
1432
+
1433
+
1434
+
1435
+
1436
+
1437
+
1438
+
1439
+
1440
+
1441
+
1442
+
1443
+
1444
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>value</code></td><td align="left"><a href="#jsonvalue"><code>JsonValue</code></a></td></tr><tr><td align="left"><code>key?</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
1445
+ <h4 id="returns-59">Returns</h4>
1446
+ <p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
1447
+ <hr>
1448
+ <p><a id="equalto"></a></p>
1449
+ <h3 id="equalto">equalTo()</h3>
1450
+ <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"> equalTo</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">value</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">JsonValue</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">key</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">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
1451
+ <p><code>equalTo(value, key?)</code> — sugar for <code>startAt(value, key) + endAt(value, key)</code>. Returns ALL matching children (no uniqueness).
1452
+ Locked by oracle observation <code>rtdb-modular-equalTo-filter.json</code>.</p>
1453
+ <h4 id="parameters-30">Parameters</h4>
1454
+ <div class="table-scroll">
1455
+
1456
+
1457
+
1458
+
1459
+
1460
+
1461
+
1462
+
1463
+
1464
+
1465
+
1466
+
1467
+
1468
+
1469
+
1470
+
1471
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>value</code></td><td align="left"><a href="#jsonvalue"><code>JsonValue</code></a></td></tr><tr><td align="left"><code>key?</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
1472
+ <h4 id="returns-60">Returns</h4>
1473
+ <p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
1474
+ <hr>
1475
+ <p><a id="forcelongpolling"></a></p>
1476
+ <h3 id="forcelongpolling">forceLongPolling()</h3>
1477
+ <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"> forceLongPolling</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
1478
+ <p><code>forceLongPolling()</code> — force the long-polling transport for all
1479
+ subsequent <code>getDatabase</code> connections.</p>
1480
+ <p>No-op: transport selection is meaningless to the in-process/worker
1481
+ sandbox, which never opens a real socket. Accepted so init code that
1482
+ calls it unconditionally compiles + runs.</p>
1483
+ <h4 id="returns-61">Returns</h4>
1484
+ <p><code>void</code></p>
1485
+ <hr>
1486
+ <p><a id="forcewebsockets"></a></p>
1487
+ <h3 id="forcewebsockets">forceWebSockets()</h3>
1488
+ <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"> forceWebSockets</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
1489
+ <p><code>forceWebSockets()</code> — force the WebSocket transport for all
1490
+ subsequent <code>getDatabase</code> connections.</p>
1491
+ <p>No-op: transport selection is not applicable to the in-process/worker
1492
+ sandbox (see <a href="#forcelongpolling">forceLongPolling</a>).</p>
1493
+ <h4 id="returns-62">Returns</h4>
1494
+ <p><code>void</code></p>
1495
+ <hr>
1496
+ <p><a id="get"></a></p>
1497
+ <h3 id="get">get()</h3>
1498
+ <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"> get</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF">&#x3C;</span><span style="color:#E5C07B">DataSnapshot</span><span style="color:#ABB2BF">>;</span></span></code></pre>
1499
+ <p><code>get(ref)</code> — one-shot read at the ref’s path. Resolves to a
1500
+ <code>DataSnapshot</code>-shaped object.</p>
1501
+ <p>Runs through the sandbox rule engine; denial throws the plain-<code>Error</code>
1502
+ shape locked by the oracle.</p>
1503
+ <p>Absent path → <code>snap.val() === null &#x26;&#x26; snap.exists() === false</code>.
1504
+ Matches the SDK’s <code>DataSnapshot.val()</code> contract.</p>
1505
+ <h4 id="parameters-31">Parameters</h4>
1506
+ <div class="table-scroll">
1507
+
1508
+
1509
+
1510
+
1511
+
1512
+
1513
+
1514
+
1515
+
1516
+
1517
+
1518
+
1519
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#query"><code>Query</code></a> | <a href="#databasereference"><code>DatabaseReference</code></a></td></tr></tbody></table></div>
1520
+ <h4 id="returns-63">Returns</h4>
1521
+ <p><code>Promise</code>&#x3C;<a href="#datasnapshot"><code>DataSnapshot</code></a>></p>
1522
+ <hr>
1523
+ <p><a id="getadmindatabase"></a></p>
1524
+ <h3 id="getadmindatabase">getAdminDatabase()</h3>
1525
+ <h4 id="call-signature">Call Signature</h4>
1526
+ <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"> getAdminDatabase</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:#E5C07B">Database</span><span style="color:#ABB2BF">;</span></span></code></pre>
1527
+ <p>Sandbox-only rules-bypass RTDB handle. Mirrors Firestore’s
1528
+ <code>getAdminFirestore(sandbox)</code> for Studio/Playground data browsers and
1529
+ controlled admin tools.</p>
1530
+ <h5 id="parameters-32">Parameters</h5>
1531
+ <div class="table-scroll">
1532
+
1533
+
1534
+
1535
+
1536
+
1537
+
1538
+
1539
+
1540
+
1541
+
1542
+
1543
+
1544
+ <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="/docs/pyric-firestore-reference-api/#sandbox"><code>Sandbox</code></a></td></tr></tbody></table></div>
1545
+ <h5 id="returns-64">Returns</h5>
1546
+ <p><a href="#database"><code>Database</code></a></p>
1547
+ <h4 id="call-signature-1">Call Signature</h4>
1548
+ <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"> getAdminDatabase</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">ctx</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">SandboxContext</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Database</span><span style="color:#ABB2BF">;</span></span></code></pre>
1549
+ <p>Sandbox-only rules-bypass RTDB handle. Mirrors Firestore’s
1550
+ <code>getAdminFirestore(sandbox)</code> for Studio/Playground data browsers and
1551
+ controlled admin tools.</p>
1552
+ <h5 id="parameters-33">Parameters</h5>
1553
+ <div class="table-scroll">
1554
+
1555
+
1556
+
1557
+
1558
+
1559
+
1560
+
1561
+
1562
+
1563
+
1564
+
1565
+
1566
+ <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="/docs/pyric-firestore-reference-api/#sandboxcontext"><code>SandboxContext</code></a></td></tr></tbody></table></div>
1567
+ <h5 id="returns-65">Returns</h5>
1568
+ <p><a href="#database"><code>Database</code></a></p>
1569
+ <h4 id="call-signature-2">Call Signature</h4>
1570
+ <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"> getAdminDatabase</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">app</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">FirebaseApp</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Database</span><span style="color:#ABB2BF">;</span></span></code></pre>
1571
+ <p>Sandbox-only rules-bypass RTDB handle. Mirrors Firestore’s
1572
+ <code>getAdminFirestore(sandbox)</code> for Studio/Playground data browsers and
1573
+ controlled admin tools.</p>
1574
+ <h5 id="parameters-34">Parameters</h5>
1575
+ <div class="table-scroll">
1576
+
1577
+
1578
+
1579
+
1580
+
1581
+
1582
+
1583
+
1584
+
1585
+
1586
+
1587
+
1588
+ <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>
1589
+ <h5 id="returns-66">Returns</h5>
1590
+ <p><a href="#database"><code>Database</code></a></p>
1591
+ <hr>
1592
+ <p><a id="getdatabase"></a></p>
1593
+ <h3 id="getdatabase">getDatabase()</h3>
1594
+ <h4 id="call-signature-3">Call Signature</h4>
1595
+ <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"> getDatabase</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">ctx</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">SandboxContext</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Database</span><span style="color:#ABB2BF">;</span></span></code></pre>
1596
+ <p>Build a sandbox Database handle:</p>
1597
+ <ul>
1598
+ <li><code>SandboxContext</code> → sandbox-backed, frozen identity.</li>
1599
+ <li><code>Sandbox</code> → sandbox-backed, live identity (per-op <code>currentUser</code>).</li>
1600
+ </ul>
1601
+ <h5 id="parameters-35">Parameters</h5>
1602
+ <div class="table-scroll">
1603
+
1604
+
1605
+
1606
+
1607
+
1608
+
1609
+
1610
+
1611
+
1612
+
1613
+
1614
+
1615
+ <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="/docs/pyric-firestore-reference-api/#sandboxcontext"><code>SandboxContext</code></a></td></tr></tbody></table></div>
1616
+ <h5 id="returns-67">Returns</h5>
1617
+ <p><a href="#database"><code>Database</code></a></p>
1618
+ <h5 id="example-1">Example</h5>
1619
+ <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>
1620
+ <span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">getDatabase</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">ref</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">set</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">get</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/database'</span><span style="color:#ABB2BF">;</span></span>
1621
+ <span class="line"></span>
1622
+ <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>
1623
+ <span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> db</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> getDatabase</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>
1624
+ <span class="line"><span style="color:#C678DD">await</span><span style="color:#61AFEF"> set</span><span style="color:#ABB2BF">(</span><span style="color:#61AFEF">ref</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">db</span><span style="color:#ABB2BF">, </span><span style="color:#98C379">'greetings/hello'</span><span style="color:#ABB2BF">), { </span><span style="color:#E06C75">text</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">'hi'</span><span style="color:#ABB2BF"> });</span></span>
1625
+ <span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> snap</span><span style="color:#56B6C2"> =</span><span style="color:#C678DD"> await</span><span style="color:#61AFEF"> get</span><span style="color:#ABB2BF">(</span><span style="color:#61AFEF">ref</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">db</span><span style="color:#ABB2BF">, </span><span style="color:#98C379">'greetings/hello'</span><span style="color:#ABB2BF">));</span></span>
1626
+ <span class="line"><span style="color:#E5C07B">console</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">log</span><span style="color:#ABB2BF">(</span><span style="color:#E5C07B">snap</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">val</span><span style="color:#ABB2BF">()); </span><span style="color:#7F848E;font-style:italic">// { text: 'hi' }</span></span></code></pre>
1627
+ <h4 id="call-signature-4">Call Signature</h4>
1628
+ <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"> getDatabase</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:#E5C07B">Database</span><span style="color:#ABB2BF">;</span></span></code></pre>
1629
+ <p>Build a sandbox Database handle:</p>
1630
+ <ul>
1631
+ <li><code>SandboxContext</code> → sandbox-backed, frozen identity.</li>
1632
+ <li><code>Sandbox</code> → sandbox-backed, live identity (per-op <code>currentUser</code>).</li>
1633
+ </ul>
1634
+ <h5 id="parameters-36">Parameters</h5>
1635
+ <div class="table-scroll">
1636
+
1637
+
1638
+
1639
+
1640
+
1641
+
1642
+
1643
+
1644
+
1645
+
1646
+
1647
+
1648
+ <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="/docs/pyric-firestore-reference-api/#sandbox"><code>Sandbox</code></a></td></tr></tbody></table></div>
1649
+ <h5 id="returns-68">Returns</h5>
1650
+ <p><a href="#database"><code>Database</code></a></p>
1651
+ <h5 id="example-2">Example</h5>
1652
+ <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>
1653
+ <span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">getDatabase</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">ref</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">set</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">get</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/database'</span><span style="color:#ABB2BF">;</span></span>
1654
+ <span class="line"></span>
1655
+ <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>
1656
+ <span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> db</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> getDatabase</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>
1657
+ <span class="line"><span style="color:#C678DD">await</span><span style="color:#61AFEF"> set</span><span style="color:#ABB2BF">(</span><span style="color:#61AFEF">ref</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">db</span><span style="color:#ABB2BF">, </span><span style="color:#98C379">'greetings/hello'</span><span style="color:#ABB2BF">), { </span><span style="color:#E06C75">text</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">'hi'</span><span style="color:#ABB2BF"> });</span></span>
1658
+ <span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> snap</span><span style="color:#56B6C2"> =</span><span style="color:#C678DD"> await</span><span style="color:#61AFEF"> get</span><span style="color:#ABB2BF">(</span><span style="color:#61AFEF">ref</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">db</span><span style="color:#ABB2BF">, </span><span style="color:#98C379">'greetings/hello'</span><span style="color:#ABB2BF">));</span></span>
1659
+ <span class="line"><span style="color:#E5C07B">console</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">log</span><span style="color:#ABB2BF">(</span><span style="color:#E5C07B">snap</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">val</span><span style="color:#ABB2BF">()); </span><span style="color:#7F848E;font-style:italic">// { text: 'hi' }</span></span></code></pre>
1660
+ <h4 id="call-signature-5">Call Signature</h4>
1661
+ <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"> getDatabase</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">app</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">FirebaseApp</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">AppDatabase</span><span style="color:#ABB2BF">;</span></span></code></pre>
1662
+ <p>Build a sandbox Database handle:</p>
1663
+ <ul>
1664
+ <li><code>SandboxContext</code> → sandbox-backed, frozen identity.</li>
1665
+ <li><code>Sandbox</code> → sandbox-backed, live identity (per-op <code>currentUser</code>).</li>
1666
+ </ul>
1667
+ <h5 id="parameters-37">Parameters</h5>
1668
+ <div class="table-scroll">
1669
+
1670
+
1671
+
1672
+
1673
+
1674
+
1675
+
1676
+
1677
+
1678
+
1679
+
1680
+
1681
+ <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>
1682
+ <h5 id="returns-69">Returns</h5>
1683
+ <p><a href="#appdatabase"><code>AppDatabase</code></a></p>
1684
+ <h5 id="example-3">Example</h5>
1685
+ <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>
1686
+ <span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">getDatabase</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">ref</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">set</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">get</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/database'</span><span style="color:#ABB2BF">;</span></span>
1687
+ <span class="line"></span>
1688
+ <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>
1689
+ <span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> db</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> getDatabase</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>
1690
+ <span class="line"><span style="color:#C678DD">await</span><span style="color:#61AFEF"> set</span><span style="color:#ABB2BF">(</span><span style="color:#61AFEF">ref</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">db</span><span style="color:#ABB2BF">, </span><span style="color:#98C379">'greetings/hello'</span><span style="color:#ABB2BF">), { </span><span style="color:#E06C75">text</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">'hi'</span><span style="color:#ABB2BF"> });</span></span>
1691
+ <span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> snap</span><span style="color:#56B6C2"> =</span><span style="color:#C678DD"> await</span><span style="color:#61AFEF"> get</span><span style="color:#ABB2BF">(</span><span style="color:#61AFEF">ref</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">db</span><span style="color:#ABB2BF">, </span><span style="color:#98C379">'greetings/hello'</span><span style="color:#ABB2BF">));</span></span>
1692
+ <span class="line"><span style="color:#E5C07B">console</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">log</span><span style="color:#ABB2BF">(</span><span style="color:#E5C07B">snap</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">val</span><span style="color:#ABB2BF">()); </span><span style="color:#7F848E;font-style:italic">// { text: 'hi' }</span></span></code></pre>
1693
+ <h4 id="call-signature-6">Call Signature</h4>
1694
+ <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"> getDatabase</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">AppDatabase</span><span style="color:#ABB2BF">;</span></span></code></pre>
1695
+ <p>Build a sandbox Database handle:</p>
1696
+ <ul>
1697
+ <li><code>SandboxContext</code> → sandbox-backed, frozen identity.</li>
1698
+ <li><code>Sandbox</code> → sandbox-backed, live identity (per-op <code>currentUser</code>).</li>
1699
+ </ul>
1700
+ <h5 id="returns-70">Returns</h5>
1701
+ <p><a href="#appdatabase"><code>AppDatabase</code></a></p>
1702
+ <h5 id="example-4">Example</h5>
1703
+ <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>
1704
+ <span class="line"><span style="color:#C678DD">import</span><span style="color:#ABB2BF"> { </span><span style="color:#E06C75">getDatabase</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">ref</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">set</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75">get</span><span style="color:#ABB2BF"> } </span><span style="color:#C678DD">from</span><span style="color:#98C379"> 'pyric/database'</span><span style="color:#ABB2BF">;</span></span>
1705
+ <span class="line"></span>
1706
+ <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>
1707
+ <span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> db</span><span style="color:#56B6C2"> =</span><span style="color:#61AFEF"> getDatabase</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>
1708
+ <span class="line"><span style="color:#C678DD">await</span><span style="color:#61AFEF"> set</span><span style="color:#ABB2BF">(</span><span style="color:#61AFEF">ref</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">db</span><span style="color:#ABB2BF">, </span><span style="color:#98C379">'greetings/hello'</span><span style="color:#ABB2BF">), { </span><span style="color:#E06C75">text</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">'hi'</span><span style="color:#ABB2BF"> });</span></span>
1709
+ <span class="line"><span style="color:#C678DD">const</span><span style="color:#E5C07B"> snap</span><span style="color:#56B6C2"> =</span><span style="color:#C678DD"> await</span><span style="color:#61AFEF"> get</span><span style="color:#ABB2BF">(</span><span style="color:#61AFEF">ref</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75">db</span><span style="color:#ABB2BF">, </span><span style="color:#98C379">'greetings/hello'</span><span style="color:#ABB2BF">));</span></span>
1710
+ <span class="line"><span style="color:#E5C07B">console</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">log</span><span style="color:#ABB2BF">(</span><span style="color:#E5C07B">snap</span><span style="color:#ABB2BF">.</span><span style="color:#61AFEF">val</span><span style="color:#ABB2BF">()); </span><span style="color:#7F848E;font-style:italic">// { text: 'hi' }</span></span></code></pre>
1711
+ <hr>
1712
+ <p><a id="gooffline"></a></p>
1713
+ <h3 id="gooffline">goOffline()</h3>
1714
+ <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"> goOffline</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">db</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Database</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
1715
+ <p><code>goOffline(db)</code> — disconnect the client from the RTDB backend.</p>
1716
+ <p>Drains this client’s one-shot onDisconnect queue. The shared data backend
1717
+ remains available to other Database clients and listeners.</p>
1718
+ <h4 id="parameters-38">Parameters</h4>
1719
+ <div class="table-scroll">
1720
+
1721
+
1722
+
1723
+
1724
+
1725
+
1726
+
1727
+
1728
+
1729
+
1730
+
1731
+
1732
+ <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="#database"><code>Database</code></a></td></tr></tbody></table></div>
1733
+ <h4 id="returns-71">Returns</h4>
1734
+ <p><code>void</code></p>
1735
+ <hr>
1736
+ <p><a id="goonline"></a></p>
1737
+ <h3 id="goonline">goOnline()</h3>
1738
+ <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"> goOnline</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">db</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Database</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
1739
+ <p><code>goOnline(db)</code> — reconnect the client to the RTDB backend.</p>
1740
+ <p>Reconnects the logical client. Executed disconnect operations are not
1741
+ resurrected; reads and writes remain synchronous in the local sandbox.</p>
1742
+ <h4 id="parameters-39">Parameters</h4>
1743
+ <div class="table-scroll">
1744
+
1745
+
1746
+
1747
+
1748
+
1749
+
1750
+
1751
+
1752
+
1753
+
1754
+
1755
+
1756
+ <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="#database"><code>Database</code></a></td></tr></tbody></table></div>
1757
+ <h4 id="returns-72">Returns</h4>
1758
+ <p><code>void</code></p>
1759
+ <hr>
1760
+ <p><a id="increment"></a></p>
1761
+ <h3 id="increment">increment()</h3>
1762
+ <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">delta</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">number</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">IncrementSentinel</span><span style="color:#ABB2BF">;</span></span></code></pre>
1763
+ <p><code>increment(delta)</code> — returns the <code>{ ".sv": { increment: delta } }</code>
1764
+ sentinel that atomically adds <code>delta</code> to the current value at the
1765
+ write’s field. Starts from <code>0</code> when the field is absent or
1766
+ non-numeric (oracle: <code>rtdb-modular-increment-from-missing.json</code>).</p>
1767
+ <p>The sandbox backend resolves it against the field’s prior value at write
1768
+ time. Mirrors <code>firebase/database</code>’s <code>increment</code> (<code>api/ServerValue.ts:38-44</code>).</p>
1769
+ <h4 id="parameters-40">Parameters</h4>
1770
+ <div class="table-scroll">
1771
+
1772
+
1773
+
1774
+
1775
+
1776
+
1777
+
1778
+
1779
+
1780
+
1781
+
1782
+
1783
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>delta</code></td><td align="left"><code>number</code></td></tr></tbody></table></div>
1784
+ <h4 id="returns-73">Returns</h4>
1785
+ <p><code>IncrementSentinel</code></p>
1786
+ <hr>
1787
+ <p><a id="limittofirst"></a></p>
1788
+ <h3 id="limittofirst">limitToFirst()</h3>
1789
+ <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"> limitToFirst</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>
1790
+ <p><code>limitToFirst(n)</code> — keep the first N children of the ordered window.
1791
+ Locked by oracle observation <code>rtdb-modular-limittofirst-vs-limittolast.json</code>.</p>
1792
+ <h4 id="parameters-41">Parameters</h4>
1793
+ <div class="table-scroll">
1794
+
1795
+
1796
+
1797
+
1798
+
1799
+
1800
+
1801
+
1802
+
1803
+
1804
+
1805
+
1806
+ <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>
1807
+ <h4 id="returns-74">Returns</h4>
1808
+ <p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
1809
+ <hr>
1810
+ <p><a id="limittolast"></a></p>
1811
+ <h3 id="limittolast">limitToLast()</h3>
1812
+ <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"> limitToLast</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>
1813
+ <p><code>limitToLast(n)</code> — keep the last N children of the ordered window.
1814
+ Locked by oracle observation <code>rtdb-modular-limittofirst-vs-limittolast.json</code>.</p>
1815
+ <h4 id="parameters-42">Parameters</h4>
1816
+ <div class="table-scroll">
1817
+
1818
+
1819
+
1820
+
1821
+
1822
+
1823
+
1824
+
1825
+
1826
+
1827
+
1828
+
1829
+ <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>
1830
+ <h4 id="returns-75">Returns</h4>
1831
+ <p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
1832
+ <hr>
1833
+ <p><a id="off"></a></p>
1834
+ <h3 id="off">off()</h3>
1835
+ <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"> off</span><span style="color:#ABB2BF">(</span></span>
1836
+ <span class="line"><span style="color:#E06C75;font-style:italic"> r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">,</span></span>
1837
+ <span class="line"><span style="color:#E06C75;font-style:italic"> eventType</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#98C379">"value"</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">ChildEvent</span><span style="color:#ABB2BF">,</span></span>
1838
+ <span class="line"><span style="color:#61AFEF"> callback</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">snap</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DataSnapshot</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">void</span><span style="color:#ABB2BF">;</span></span></code></pre>
1839
+ <p><code>off(ref, eventType?, callback?)</code> — unsubscribe variant.</p>
1840
+ <p>Semantics (locked by oracle observation
1841
+ <code>packages/conformance/observations/rtdb-modular/rtdb-modular-off-stops-child-fires.json</code>):</p>
1842
+ <ul>
1843
+ <li><code>off(ref)</code> (no eventType) removes ALL listeners at that ref —
1844
+ value + every child event variety.</li>
1845
+ <li><code>off(ref, 'value')</code> removes only <code>value</code> listeners.</li>
1846
+ <li><code>off(ref, 'child_added')</code> (or any child event type) removes only
1847
+ that variety.</li>
1848
+ <li><code>off(ref, eventType, cb)</code> removes only the matching callback.</li>
1849
+ </ul>
1850
+ <p>The returned-unsubscribe pattern from <code>onValue</code> / <code>onChild*</code> is
1851
+ functionally equivalent to <code>off(ref, eventType, cb)</code> for a specific
1852
+ registration — both are supported.</p>
1853
+ <h4 id="parameters-43">Parameters</h4>
1854
+ <div class="table-scroll">
1855
+
1856
+
1857
+
1858
+
1859
+
1860
+
1861
+
1862
+
1863
+
1864
+
1865
+
1866
+
1867
+
1868
+
1869
+
1870
+
1871
+
1872
+
1873
+
1874
+
1875
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#query"><code>Query</code></a> | <a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><code>eventType?</code></td><td align="left"><code>"value"</code> | <code>ChildEvent</code></td></tr><tr><td align="left"><code>callback?</code></td><td align="left">(<code>snap</code>: <a href="#datasnapshot"><code>DataSnapshot</code></a>) => <code>void</code></td></tr></tbody></table></div>
1876
+ <h4 id="returns-76">Returns</h4>
1877
+ <p><code>void</code></p>
1878
+ <hr>
1879
+ <p><a id="onchildadded"></a></p>
1880
+ <h3 id="onchildadded">onChildAdded()</h3>
1881
+ <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"> onChildAdded</span><span style="color:#ABB2BF">(</span></span>
1882
+ <span class="line"><span style="color:#E06C75;font-style:italic"> r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">,</span></span>
1883
+ <span class="line"><span style="color:#61AFEF"> cb</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">snap</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DataSnapshot</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">previousChildName</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">,</span></span>
1884
+ <span class="line"><span style="color:#E06C75;font-style:italic"> cancelCallbackOrOptions</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">ListenOptions</span><span style="color:#ABB2BF"> | (</span><span style="color:#E06C75;font-style:italic">error</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Error</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">,</span></span>
1885
+ <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">ListenOptions</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Unsubscribe</span><span style="color:#ABB2BF">;</span></span></code></pre>
1886
+ <p><code>onChildAdded(ref, cb)</code> — subscribe to child-added events at the
1887
+ ref’s path.</p>
1888
+ <p>Semantics (locked by oracle observations under
1889
+ <code>packages/conformance/observations/rtdb-modular/rtdb-modular-onchildadded-*.json</code>):</p>
1890
+ <ul>
1891
+ <li>On subscribe, replays every existing direct child of <code>ref</code>’s path
1892
+ (one fire per existing key, in default priority/key order).</li>
1893
+ <li>After subscribe, fires exactly once per new direct child write.</li>
1894
+ </ul>
1895
+ <p>Also accepts a <a href="#query">Query</a> (a <code>query(ref, ...)</code> with <code>orderBy*</code> /
1896
+ <code>limitTo*</code> constraints): child events are then computed against the
1897
+ ordered, windowed result — a child ENTERING the window fires
1898
+ <code>child_added</code>; on subscribe the current window is replayed in window
1899
+ order.</p>
1900
+ <p>Returns an unsubscribe; calling it twice is a no-op.</p>
1901
+ <h4 id="parameters-44">Parameters</h4>
1902
+ <div class="table-scroll">
1903
+
1904
+
1905
+
1906
+
1907
+
1908
+
1909
+
1910
+
1911
+
1912
+
1913
+
1914
+
1915
+
1916
+
1917
+
1918
+
1919
+
1920
+
1921
+
1922
+
1923
+
1924
+
1925
+
1926
+
1927
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#query"><code>Query</code></a> | <a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><code>cb</code></td><td align="left">(<code>snap</code>: <a href="#datasnapshot"><code>DataSnapshot</code></a>, <code>previousChildName</code>: <code>string</code>) => <code>void</code></td></tr><tr><td align="left"><code>cancelCallbackOrOptions?</code></td><td align="left"><a href="#listenoptions"><code>ListenOptions</code></a> | (<code>error</code>: <code>Error</code>) => <code>void</code></td></tr><tr><td align="left"><code>options?</code></td><td align="left"><a href="#listenoptions"><code>ListenOptions</code></a></td></tr></tbody></table></div>
1928
+ <h4 id="returns-77">Returns</h4>
1929
+ <p><a href="#unsubscribe"><code>Unsubscribe</code></a></p>
1930
+ <hr>
1931
+ <p><a id="onchildchanged"></a></p>
1932
+ <h3 id="onchildchanged">onChildChanged()</h3>
1933
+ <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"> onChildChanged</span><span style="color:#ABB2BF">(</span></span>
1934
+ <span class="line"><span style="color:#E06C75;font-style:italic"> r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">,</span></span>
1935
+ <span class="line"><span style="color:#61AFEF"> cb</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">snap</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DataSnapshot</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">previousChildName</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">,</span></span>
1936
+ <span class="line"><span style="color:#E06C75;font-style:italic"> cancelCallbackOrOptions</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">ListenOptions</span><span style="color:#ABB2BF"> | (</span><span style="color:#E06C75;font-style:italic">error</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Error</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">,</span></span>
1937
+ <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">ListenOptions</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Unsubscribe</span><span style="color:#ABB2BF">;</span></span></code></pre>
1938
+ <p><code>onChildChanged(ref, cb)</code> — subscribe to child-changed events.</p>
1939
+ <p>Semantics (oracle: <code>rtdb-modular-onchildchanged-fires-on-update</code>):</p>
1940
+ <ul>
1941
+ <li>No initial replay.</li>
1942
+ <li>Fires when an existing direct child’s value transitions to a
1943
+ NEW non-null value. Snapshot carries the NEW value.</li>
1944
+ <li>Does NOT fire for added or removed children.</li>
1945
+ </ul>
1946
+ <p>Also accepts a <a href="#query">Query</a>: fires when a child that is IN the query
1947
+ window changes value (an in-window update).</p>
1948
+ <h4 id="parameters-45">Parameters</h4>
1949
+ <div class="table-scroll">
1950
+
1951
+
1952
+
1953
+
1954
+
1955
+
1956
+
1957
+
1958
+
1959
+
1960
+
1961
+
1962
+
1963
+
1964
+
1965
+
1966
+
1967
+
1968
+
1969
+
1970
+
1971
+
1972
+
1973
+
1974
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#query"><code>Query</code></a> | <a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><code>cb</code></td><td align="left">(<code>snap</code>: <a href="#datasnapshot"><code>DataSnapshot</code></a>, <code>previousChildName</code>: <code>string</code>) => <code>void</code></td></tr><tr><td align="left"><code>cancelCallbackOrOptions?</code></td><td align="left"><a href="#listenoptions"><code>ListenOptions</code></a> | (<code>error</code>: <code>Error</code>) => <code>void</code></td></tr><tr><td align="left"><code>options?</code></td><td align="left"><a href="#listenoptions"><code>ListenOptions</code></a></td></tr></tbody></table></div>
1975
+ <h4 id="returns-78">Returns</h4>
1976
+ <p><a href="#unsubscribe"><code>Unsubscribe</code></a></p>
1977
+ <hr>
1978
+ <p><a id="onchildmoved"></a></p>
1979
+ <h3 id="onchildmoved">onChildMoved()</h3>
1980
+ <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"> onChildMoved</span><span style="color:#ABB2BF">(</span></span>
1981
+ <span class="line"><span style="color:#E06C75;font-style:italic"> r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">,</span></span>
1982
+ <span class="line"><span style="color:#61AFEF"> cb</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">snap</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DataSnapshot</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">previousChildName</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">,</span></span>
1983
+ <span class="line"><span style="color:#E06C75;font-style:italic"> cancelCallbackOrOptions</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">ListenOptions</span><span style="color:#ABB2BF"> | (</span><span style="color:#E06C75;font-style:italic">error</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Error</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">,</span></span>
1984
+ <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">ListenOptions</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Unsubscribe</span><span style="color:#ABB2BF">;</span></span></code></pre>
1985
+ <p><code>onChildMoved(ref, cb)</code> — subscribe to child-moved events.</p>
1986
+ <p>Semantics (oracle: <code>rtdb-modular-onchildmoved-with-orderby</code>):</p>
1987
+ <ul>
1988
+ <li>Explicit queries use their active <code>orderBy*</code> index.</li>
1989
+ <li>Plain refs use Firebase’s default priority index, so changing a
1990
+ child’s priority can move it while an ordinary value-only write does not.</li>
1991
+ </ul>
1992
+ <p>Accepts a <a href="#query">Query</a> and fires when the active ordered value changes,
1993
+ including the Firebase <code>previousChildName</code> second callback argument.</p>
1994
+ <h4 id="parameters-46">Parameters</h4>
1995
+ <div class="table-scroll">
1996
+
1997
+
1998
+
1999
+
2000
+
2001
+
2002
+
2003
+
2004
+
2005
+
2006
+
2007
+
2008
+
2009
+
2010
+
2011
+
2012
+
2013
+
2014
+
2015
+
2016
+
2017
+
2018
+
2019
+
2020
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#query"><code>Query</code></a> | <a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><code>cb</code></td><td align="left">(<code>snap</code>: <a href="#datasnapshot"><code>DataSnapshot</code></a>, <code>previousChildName</code>: <code>string</code>) => <code>void</code></td></tr><tr><td align="left"><code>cancelCallbackOrOptions?</code></td><td align="left"><a href="#listenoptions"><code>ListenOptions</code></a> | (<code>error</code>: <code>Error</code>) => <code>void</code></td></tr><tr><td align="left"><code>options?</code></td><td align="left"><a href="#listenoptions"><code>ListenOptions</code></a></td></tr></tbody></table></div>
2021
+ <h4 id="returns-79">Returns</h4>
2022
+ <p><a href="#unsubscribe"><code>Unsubscribe</code></a></p>
2023
+ <hr>
2024
+ <p><a id="onchildremoved"></a></p>
2025
+ <h3 id="onchildremoved">onChildRemoved()</h3>
2026
+ <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"> onChildRemoved</span><span style="color:#ABB2BF">(</span></span>
2027
+ <span class="line"><span style="color:#E06C75;font-style:italic"> r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">,</span></span>
2028
+ <span class="line"><span style="color:#61AFEF"> cb</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">snap</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DataSnapshot</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">previousChildName</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">,</span></span>
2029
+ <span class="line"><span style="color:#E06C75;font-style:italic"> cancelCallbackOrOptions</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">ListenOptions</span><span style="color:#ABB2BF"> | (</span><span style="color:#E06C75;font-style:italic">error</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Error</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">,</span></span>
2030
+ <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">ListenOptions</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Unsubscribe</span><span style="color:#ABB2BF">;</span></span></code></pre>
2031
+ <p><code>onChildRemoved(ref, cb)</code> — subscribe to child-removed events.</p>
2032
+ <p>Semantics (oracle: <code>rtdb-modular-onchildremoved-fires-on-delete</code>):</p>
2033
+ <ul>
2034
+ <li>No initial replay.</li>
2035
+ <li>Fires when a direct child is deleted (via <code>remove(child)</code> or
2036
+ <code>set(child, null)</code>).</li>
2037
+ <li>Snapshot carries the PRIOR (now-removed) value — the listener
2038
+ sees what was there before deletion.</li>
2039
+ </ul>
2040
+ <p>Also accepts a <a href="#query">Query</a>: a child LEAVING the query window (e.g.
2041
+ displaced past a <code>limitTo*</code> boundary or filtered out) fires
2042
+ <code>child_removed</code> carrying its prior value.</p>
2043
+ <h4 id="parameters-47">Parameters</h4>
2044
+ <div class="table-scroll">
2045
+
2046
+
2047
+
2048
+
2049
+
2050
+
2051
+
2052
+
2053
+
2054
+
2055
+
2056
+
2057
+
2058
+
2059
+
2060
+
2061
+
2062
+
2063
+
2064
+
2065
+
2066
+
2067
+
2068
+
2069
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#query"><code>Query</code></a> | <a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><code>cb</code></td><td align="left">(<code>snap</code>: <a href="#datasnapshot"><code>DataSnapshot</code></a>, <code>previousChildName</code>: <code>string</code>) => <code>void</code></td></tr><tr><td align="left"><code>cancelCallbackOrOptions?</code></td><td align="left"><a href="#listenoptions"><code>ListenOptions</code></a> | (<code>error</code>: <code>Error</code>) => <code>void</code></td></tr><tr><td align="left"><code>options?</code></td><td align="left"><a href="#listenoptions"><code>ListenOptions</code></a></td></tr></tbody></table></div>
2070
+ <h4 id="returns-80">Returns</h4>
2071
+ <p><a href="#unsubscribe"><code>Unsubscribe</code></a></p>
2072
+ <hr>
2073
+ <p><a id="ondisconnect-1"></a></p>
2074
+ <h3 id="ondisconnect-1">onDisconnect()</h3>
2075
+ <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"> onDisconnect</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">OnDisconnect</span><span style="color:#ABB2BF">;</span></span></code></pre>
2076
+ <p>Register a one-shot write for this Database client’s next disconnect.
2077
+ Registration checks rules immediately; execution checks them again.</p>
2078
+ <h4 id="parameters-48">Parameters</h4>
2079
+ <div class="table-scroll">
2080
+
2081
+
2082
+
2083
+
2084
+
2085
+
2086
+
2087
+
2088
+
2089
+
2090
+
2091
+
2092
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr></tbody></table></div>
2093
+ <h4 id="returns-81">Returns</h4>
2094
+ <p><a href="#ondisconnect"><code>OnDisconnect</code></a></p>
2095
+ <hr>
2096
+ <p><a id="onvalue"></a></p>
2097
+ <h3 id="onvalue">onValue()</h3>
2098
+ <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"> onValue</span><span style="color:#ABB2BF">(</span></span>
2099
+ <span class="line"><span style="color:#E06C75;font-style:italic"> r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">,</span></span>
2100
+ <span class="line"><span style="color:#61AFEF"> cb</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">snap</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DataSnapshot</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">,</span></span>
2101
+ <span class="line"><span style="color:#E06C75;font-style:italic"> cancelCallbackOrOptions</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">ListenOptions</span><span style="color:#ABB2BF"> | (</span><span style="color:#E06C75;font-style:italic">error</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Error</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> void</span><span style="color:#ABB2BF">,</span></span>
2102
+ <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">ListenOptions</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Unsubscribe</span><span style="color:#ABB2BF">;</span></span></code></pre>
2103
+ <p><code>onValue(ref, cb)</code> — subscribe to value changes at the ref’s path.</p>
2104
+ <p>Fires immediately on subscribe with the current value (or
2105
+ <code>null</code> + <code>exists: false</code> for an absent path), then on every
2106
+ subsequent write that touches the path or any descendant.</p>
2107
+ <p>Returns an unsubscribe function. The unsubscribe is idempotent;
2108
+ calling it twice is a no-op.</p>
2109
+ <p><code>options.onlyOnce</code> (DB-B12): when <code>true</code>, the listener auto-unsubscribes
2110
+ after its first fire (mirrors <code>api/Reference_impl.ts:975-980</code>).</p>
2111
+ <p>With a cancellation callback, an initially denied listen returns normally
2112
+ and reports the Firebase <code>PERMISSION_DENIED</code> error asynchronously. Without
2113
+ one, the sandbox preserves its legacy synchronous throw.</p>
2114
+ <h4 id="parameters-49">Parameters</h4>
2115
+ <div class="table-scroll">
2116
+
2117
+
2118
+
2119
+
2120
+
2121
+
2122
+
2123
+
2124
+
2125
+
2126
+
2127
+
2128
+
2129
+
2130
+
2131
+
2132
+
2133
+
2134
+
2135
+
2136
+
2137
+
2138
+
2139
+
2140
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#query"><code>Query</code></a> | <a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><code>cb</code></td><td align="left">(<code>snap</code>: <a href="#datasnapshot"><code>DataSnapshot</code></a>) => <code>void</code></td></tr><tr><td align="left"><code>cancelCallbackOrOptions?</code></td><td align="left"><a href="#listenoptions"><code>ListenOptions</code></a> | (<code>error</code>: <code>Error</code>) => <code>void</code></td></tr><tr><td align="left"><code>options?</code></td><td align="left"><a href="#listenoptions"><code>ListenOptions</code></a></td></tr></tbody></table></div>
2141
+ <h4 id="returns-82">Returns</h4>
2142
+ <p><a href="#unsubscribe"><code>Unsubscribe</code></a></p>
2143
+ <hr>
2144
+ <p><a id="orderbychild"></a></p>
2145
+ <h3 id="orderbychild">orderByChild()</h3>
2146
+ <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"> orderByChild</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">path</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
2147
+ <p><code>orderByChild('path')</code> — order children by the value at the nested
2148
+ child path. Locked by oracle observation
2149
+ <code>rtdb-modular-orderbychild-window.json</code>.</p>
2150
+ <h4 id="parameters-50">Parameters</h4>
2151
+ <div class="table-scroll">
2152
+
2153
+
2154
+
2155
+
2156
+
2157
+
2158
+
2159
+
2160
+
2161
+
2162
+
2163
+
2164
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>path</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
2165
+ <h4 id="returns-83">Returns</h4>
2166
+ <p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
2167
+ <hr>
2168
+ <p><a id="orderbykey"></a></p>
2169
+ <h3 id="orderbykey">orderByKey()</h3>
2170
+ <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"> orderByKey</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
2171
+ <p><code>orderByKey()</code> — order children lexicographically by key string.
2172
+ Locked by oracle observation <code>rtdb-modular-orderbykey-window.json</code>.</p>
2173
+ <h4 id="returns-84">Returns</h4>
2174
+ <p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
2175
+ <hr>
2176
+ <p><a id="orderbypriority"></a></p>
2177
+ <h3 id="orderbypriority">orderByPriority()</h3>
2178
+ <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"> orderByPriority</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
2179
+ <p><code>orderByPriority()</code> — order children by their RTDB priority metadata,
2180
+ with Firebase’s key ordering as the tie-breaker.</p>
2181
+ <h4 id="returns-85">Returns</h4>
2182
+ <p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
2183
+ <hr>
2184
+ <p><a id="orderbyvalue"></a></p>
2185
+ <h3 id="orderbyvalue">orderByValue()</h3>
2186
+ <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"> orderByValue</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
2187
+ <p><code>orderByValue()</code> — order children by primitive value. Prod requires
2188
+ <code>.indexOn: ".value"</code> (oracle: <code>rtdb-modular-orderbyvalue-numeric.json</code>
2189
+ threw <code>Index not defined</code> against blockingfun); sandbox does NOT
2190
+ enforce indexes (the rules engine here checks read-allow only, not
2191
+ query-index conformance).</p>
2192
+ <h4 id="returns-86">Returns</h4>
2193
+ <p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
2194
+ <hr>
2195
+ <p><a id="push"></a></p>
2196
+ <h3 id="push">push()</h3>
2197
+ <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"> push</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">value</span><span style="color:#C678DD">?</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">ThenableReference</span><span style="color:#ABB2BF">;</span></span></code></pre>
2198
+ <p><code>push(ref, value?)</code> — mint an auto-id child key under <code>ref</code>’s path,
2199
+ optionally writing <code>value</code> at the new child.</p>
2200
+ <p>Returns a ref at the new child path. The ref’s <code>key</code> is the minted
2201
+ id (locked by oracle observation <code>rtdb-push-autoid-format.json</code>:
2202
+ 20 chars, leading <code>-</code>, lex-sortable).</p>
2203
+ <p>Production note: the key is minted <strong>client-side</strong> (no server
2204
+ round-trip required); it’s available synchronously on the returned
2205
+ ref even when the optional write is denied by rules. The oracle
2206
+ observation confirms this — the sandbox matches.</p>
2207
+ <h4 id="parameters-51">Parameters</h4>
2208
+ <div class="table-scroll">
2209
+
2210
+
2211
+
2212
+
2213
+
2214
+
2215
+
2216
+
2217
+
2218
+
2219
+
2220
+
2221
+
2222
+
2223
+
2224
+
2225
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><code>value?</code></td><td align="left"><code>unknown</code></td></tr></tbody></table></div>
2226
+ <h4 id="returns-87">Returns</h4>
2227
+ <p><a href="#thenablereference"><code>ThenableReference</code></a></p>
2228
+ <hr>
2229
+ <p><a id="pushkey"></a></p>
2230
+ <h3 id="pushkey">pushKey()</h3>
2231
+ <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"> pushKey</span><span style="color:#ABB2BF">(): </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">;</span></span></code></pre>
2232
+ <p>Pre-mint a push key without writing. Used by callers that need the
2233
+ key for a multi-path update (<code>update(rootRef, { [\</code>/users/${key}`]: … })`).
2234
+ Returns a freshly-minted key.</p>
2235
+ <h4 id="returns-88">Returns</h4>
2236
+ <p><code>string</code></p>
2237
+ <hr>
2238
+ <p><a id="query-1"></a></p>
2239
+ <h3 id="query-1">query()</h3>
2240
+ <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:#E06C75;font-style:italic">refOrQuery</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Query</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">DatabaseReference</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></code></pre>
2241
+ <p><code>query(ref, ...constraints)</code> — wrap a ref in an immutable
2242
+ constraint chain. The resulting <a href="#query">Query</a> routes through
2243
+ <a href="#get">get</a>/<a href="#onvalue">onValue</a> and applies the ordering + filtering +
2244
+ limit pipeline on the sandbox backend.</p>
2245
+ <p>Chaining is supported — <code>query(query(ref, orderByChild('x')), limitToFirst(2))</code> folds both constraints into one spec.</p>
2246
+ <p>Locked semantics (oracle):</p>
2247
+ <ul>
2248
+ <li><code>orderByChild('p') + startAt(v) + endAt(w)</code> is BOTH-inclusive
2249
+ (<code>rtdb-modular-orderbychild-window.json</code>).</li>
2250
+ <li><code>orderByKey() + startAt('b') + endAt('d')</code> matches <code>[b, c, d]</code>
2251
+ (<code>rtdb-modular-orderbykey-window.json</code>).</li>
2252
+ <li><code>orderByValue() + limitToFirst(3)</code> returns the 3 smallest by
2253
+ value (<code>rtdb-modular-orderbyvalue-numeric.json</code> — note: prod
2254
+ requires <code>.indexOn: ".value"</code>; sandbox does not enforce indexes).</li>
2255
+ <li><code>orderByChild('group') + equalTo('b')</code> returns ALL matching
2256
+ children (<code>rtdb-modular-equalTo-filter.json</code>).</li>
2257
+ <li><code>limitToFirst(N)</code> / <code>limitToLast(N)</code> take from the start / end of
2258
+ the ordered window (<code>rtdb-modular-limittofirst-vs-limittolast.json</code>).</li>
2259
+ <li><code>startAfter</code> / <code>endBefore</code> are EXCLUSIVE
2260
+ (<code>rtdb-modular-startafter-endbefore-exclusive.json</code>).</li>
2261
+ </ul>
2262
+ <h4 id="parameters-52">Parameters</h4>
2263
+ <div class="table-scroll">
2264
+
2265
+
2266
+
2267
+
2268
+
2269
+
2270
+
2271
+
2272
+
2273
+
2274
+
2275
+
2276
+
2277
+
2278
+
2279
+
2280
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>refOrQuery</code></td><td align="left"><a href="#query"><code>Query</code></a> | <a href="#databasereference"><code>DatabaseReference</code></a></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>
2281
+ <h4 id="returns-89">Returns</h4>
2282
+ <p><a href="#query"><code>Query</code></a></p>
2283
+ <hr>
2284
+ <p><a id="ref-6"></a></p>
2285
+ <h3 id="ref">ref()</h3>
2286
+ <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"> ref</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">db</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Database</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">path</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">DatabaseReference</span><span style="color:#ABB2BF">;</span></span></code></pre>
2287
+ <p>Build a <a href="#databasereference">DatabaseReference</a> at <code>path</code> (default root).</p>
2288
+ <p>Path normalisation: leading + trailing slashes are stripped;
2289
+ empty path / <code>'/'</code> becomes the root.</p>
2290
+ <h4 id="parameters-53">Parameters</h4>
2291
+ <div class="table-scroll">
2292
+
2293
+
2294
+
2295
+
2296
+
2297
+
2298
+
2299
+
2300
+
2301
+
2302
+
2303
+
2304
+
2305
+
2306
+
2307
+
2308
+ <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="#database"><code>Database</code></a></td></tr><tr><td align="left"><code>path?</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
2309
+ <h4 id="returns-90">Returns</h4>
2310
+ <p><a href="#databasereference"><code>DatabaseReference</code></a></p>
2311
+ <hr>
2312
+ <p><a id="reffromurl"></a></p>
2313
+ <h3 id="reffromurl">refFromURL()</h3>
2314
+ <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"> refFromURL</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">db</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Database</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">url</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">;</span></span></code></pre>
2315
+ <p><code>refFromURL(db, url)</code> — build a <a href="#databasereference">DatabaseReference</a> from an
2316
+ absolute database URL (<code>https://&#x3C;namespace>.firebaseio.com/path</code>).</p>
2317
+ <p>The sandbox is single-database, so only the URL path is honored; unlike the
2318
+ production SDK, the host is not checked against the database namespace.</p>
2319
+ <h4 id="parameters-54">Parameters</h4>
2320
+ <div class="table-scroll">
2321
+
2322
+
2323
+
2324
+
2325
+
2326
+
2327
+
2328
+
2329
+
2330
+
2331
+
2332
+
2333
+
2334
+
2335
+
2336
+
2337
+ <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="#database"><code>Database</code></a></td></tr><tr><td align="left"><code>url</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
2338
+ <h4 id="returns-91">Returns</h4>
2339
+ <p><a href="#databasereference"><code>DatabaseReference</code></a></p>
2340
+ <hr>
2341
+ <p><a id="remove-2"></a></p>
2342
+ <h3 id="remove-1">remove()</h3>
2343
+ <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"> remove</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF">&#x3C;</span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">>;</span></span></code></pre>
2344
+ <p><code>remove(ref)</code> — delete the subtree at the ref’s path.</p>
2345
+ <p>RTDB invariant (oracle: <code>rtdb-remove-vs-set-null.json</code>): equivalent
2346
+ to <code>set(ref, null)</code>. The sandbox backend dispatches <code>remove</code> through
2347
+ the same code path as <code>set(_, null)</code>.</p>
2348
+ <h4 id="parameters-55">Parameters</h4>
2349
+ <div class="table-scroll">
2350
+
2351
+
2352
+
2353
+
2354
+
2355
+
2356
+
2357
+
2358
+
2359
+
2360
+
2361
+
2362
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr></tbody></table></div>
2363
+ <h4 id="returns-92">Returns</h4>
2364
+ <p><code>Promise</code>&#x3C;<code>void</code>></p>
2365
+ <hr>
2366
+ <p><a id="runtransaction"></a></p>
2367
+ <h3 id="runtransaction">runTransaction()</h3>
2368
+ <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">&#x3C;</span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">>(</span></span>
2369
+ <span class="line"><span style="color:#E06C75;font-style:italic"> r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">,</span></span>
2370
+ <span class="line"><span style="color:#61AFEF"> transactionUpdate</span><span style="color:#ABB2BF">: (</span><span style="color:#E06C75;font-style:italic">current</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">T</span><span style="color:#ABB2BF">) </span><span style="color:#C678DD">=></span><span style="color:#E5C07B"> T</span><span style="color:#ABB2BF">,</span></span>
2371
+ <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">TransactionOptions</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF">&#x3C;</span><span style="color:#E5C07B">TransactionResult</span><span style="color:#ABB2BF">>;</span></span></code></pre>
2372
+ <p><code>runTransaction(ref, transactionUpdate, options?)</code> — atomic
2373
+ read-modify-write.</p>
2374
+ <p>Contract (oracle-locked):</p>
2375
+ <ol>
2376
+ <li><code>transactionUpdate</code> is called with the CURRENT value at <code>ref</code>’s
2377
+ path. For an absent path the arg is <code>null</code> (NOT <code>undefined</code>);
2378
+ oracle:
2379
+ <code>rtdb-modular-runtransaction-current-value-arg.json</code> →
2380
+ <code>missingFirstWasNull: true</code>.</li>
2381
+ <li>Returning <code>undefined</code> from the update fn ABORTS the transaction:
2382
+ resolves <code>{ committed: false, snapshot }</code> where the snapshot is
2383
+ the pre-transaction value; oracle:
2384
+ <code>rtdb-modular-runtransaction-abort-undefined.json</code> → <code>committed: false, snapVal: null</code>.</li>
2385
+ <li>Returning any defined value WRITES that value (rules-checked);
2386
+ resolves <code>{ committed: true, snapshot }</code> where <code>snapshot.val()</code>
2387
+ is the committed value; oracle:
2388
+ <code>rtdb-modular-runtransaction-success.json</code> → <code>committedNewValue: true</code> and
2389
+ <code>rtdb-modular-runtransaction-returns-committed-snapshot.json</code>.</li>
2390
+ <li>If rules deny the write, the promise REJECTS with a plain
2391
+ <code>Error</code> whose <code>message === 'permission_denied'</code> and NO <code>.code</code>
2392
+ field (distinct from <code>set</code>/<code>get</code>’s <code>'PERMISSION_DENIED: Permission denied'</code>); oracle:
2393
+ <code>rtdb-modular-runtransaction-on-rules-denied-path.json</code>.</li>
2394
+ </ol>
2395
+ <p><code>options.applyLocally</code> (default <code>true</code>): when <code>false</code>, the
2396
+ intermediate optimistic value is NOT fanned out to listeners — they
2397
+ see only the committed value. In a single-client harness this is
2398
+ usually invisible; we honor the flag for prod-parity. Oracle
2399
+ observation <code>rtdb-modular-runtransaction-options-applylocally.json</code>
2400
+ confirms both branches commit and end at the same value; the
2401
+ intermediate-fire difference isn’t observable from a single client.</p>
2402
+ <p>A synchronous overlapping write during the update callback invalidates the
2403
+ read and retries the callback. Writes to unrelated paths do not conflict.</p>
2404
+ <h4 id="type-parameters-2">Type Parameters</h4>
2405
+ <div class="table-scroll">
2406
+
2407
+
2408
+
2409
+
2410
+
2411
+
2412
+
2413
+
2414
+
2415
+
2416
+ <table><thead><tr><th align="left">Type Parameter</th></tr></thead><tbody><tr><td align="left"><code>T</code></td></tr></tbody></table></div>
2417
+ <h4 id="parameters-56">Parameters</h4>
2418
+ <div class="table-scroll">
2419
+
2420
+
2421
+
2422
+
2423
+
2424
+
2425
+
2426
+
2427
+
2428
+
2429
+
2430
+
2431
+
2432
+
2433
+
2434
+
2435
+
2436
+
2437
+
2438
+
2439
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><code>transactionUpdate</code></td><td align="left">(<code>current</code>: <code>T</code>) => <code>T</code></td></tr><tr><td align="left"><code>options?</code></td><td align="left"><a href="#transactionoptions"><code>TransactionOptions</code></a></td></tr></tbody></table></div>
2440
+ <h4 id="returns-93">Returns</h4>
2441
+ <p><code>Promise</code>&#x3C;<a href="#transactionresult"><code>TransactionResult</code></a>></p>
2442
+ <hr>
2443
+ <p><a id="servertimestamp"></a></p>
2444
+ <h3 id="servertimestamp">serverTimestamp()</h3>
2445
+ <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">ServerTimestampSentinel</span><span style="color:#ABB2BF">;</span></span></code></pre>
2446
+ <p><code>serverTimestamp()</code> — returns the <code>{ ".sv": "timestamp" }</code> sentinel
2447
+ the wire encoder recognises. Resolves to <code>Date.now()</code> (epoch ms) on
2448
+ write — locked by the prod SDK’s resolved-as-number contract
2449
+ (oracle: <code>rtdb-servertimestamp-resolves.json</code>).</p>
2450
+ <p>The sandbox backend recognises the marker.</p>
2451
+ <h4 id="returns-94">Returns</h4>
2452
+ <p><code>ServerTimestampSentinel</code></p>
2453
+ <hr>
2454
+ <p><a id="set-2"></a></p>
2455
+ <h3 id="set-1">set()</h3>
2456
+ <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"> set</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">, </span><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">Promise</span><span style="color:#ABB2BF">&#x3C;</span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">>;</span></span></code></pre>
2457
+ <p><code>set(ref, value)</code> — replace the value at <code>ref</code>’s path. <code>null</code>
2458
+ deletes (matches the RTDB invariant — locked by oracle observation
2459
+ <code>rtdb-remove-vs-set-null.json</code>).</p>
2460
+ <p><code>serverTimestamp()</code> sentinels are resolved at write time.</p>
2461
+ <h4 id="parameters-57">Parameters</h4>
2462
+ <div class="table-scroll">
2463
+
2464
+
2465
+
2466
+
2467
+
2468
+
2469
+
2470
+
2471
+
2472
+
2473
+
2474
+
2475
+
2476
+
2477
+
2478
+
2479
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><code>value</code></td><td align="left"><code>unknown</code></td></tr></tbody></table></div>
2480
+ <h4 id="returns-95">Returns</h4>
2481
+ <p><code>Promise</code>&#x3C;<code>void</code>></p>
2482
+ <hr>
2483
+ <p><a id="setpriority"></a></p>
2484
+ <h3 id="setpriority">setPriority()</h3>
2485
+ <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"> setPriority</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">priority</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">number</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF">&#x3C;</span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">>;</span></span></code></pre>
2486
+ <h4 id="parameters-58">Parameters</h4>
2487
+ <div class="table-scroll">
2488
+
2489
+
2490
+
2491
+
2492
+
2493
+
2494
+
2495
+
2496
+
2497
+
2498
+
2499
+
2500
+
2501
+
2502
+
2503
+
2504
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><code>priority</code></td><td align="left"><code>string</code> | <code>number</code></td></tr></tbody></table></div>
2505
+ <h4 id="returns-96">Returns</h4>
2506
+ <p><code>Promise</code>&#x3C;<code>void</code>></p>
2507
+ <hr>
2508
+ <p><a id="setwithpriority-2"></a></p>
2509
+ <h3 id="setwithpriority-1">setWithPriority()</h3>
2510
+ <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"> setWithPriority</span><span style="color:#ABB2BF">(</span></span>
2511
+ <span class="line"><span style="color:#E06C75;font-style:italic"> r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">,</span></span>
2512
+ <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>
2513
+ <span class="line"><span style="color:#E06C75;font-style:italic">priority</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF"> | </span><span style="color:#E5C07B">number</span><span style="color:#ABB2BF">): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF">&#x3C;</span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">>;</span></span></code></pre>
2514
+ <h4 id="parameters-59">Parameters</h4>
2515
+ <div class="table-scroll">
2516
+
2517
+
2518
+
2519
+
2520
+
2521
+
2522
+
2523
+
2524
+
2525
+
2526
+
2527
+
2528
+
2529
+
2530
+
2531
+
2532
+
2533
+
2534
+
2535
+
2536
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><code>value</code></td><td align="left"><code>unknown</code></td></tr><tr><td align="left"><code>priority</code></td><td align="left"><code>string</code> | <code>number</code></td></tr></tbody></table></div>
2537
+ <h4 id="returns-97">Returns</h4>
2538
+ <p><code>Promise</code>&#x3C;<code>void</code>></p>
2539
+ <hr>
2540
+ <p><a id="startafter"></a></p>
2541
+ <h3 id="startafter">startAfter()</h3>
2542
+ <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">value</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">JsonValue</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">key</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">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
2543
+ <p><code>startAfter(value, key?)</code> — EXCLUSIVE lower bound. Locked by
2544
+ <code>rtdb-modular-startafter-endbefore-exclusive.json</code>.</p>
2545
+ <h4 id="parameters-60">Parameters</h4>
2546
+ <div class="table-scroll">
2547
+
2548
+
2549
+
2550
+
2551
+
2552
+
2553
+
2554
+
2555
+
2556
+
2557
+
2558
+
2559
+
2560
+
2561
+
2562
+
2563
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>value</code></td><td align="left"><a href="#jsonvalue"><code>JsonValue</code></a></td></tr><tr><td align="left"><code>key?</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
2564
+ <h4 id="returns-98">Returns</h4>
2565
+ <p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
2566
+ <hr>
2567
+ <p><a id="startat"></a></p>
2568
+ <h3 id="startat">startAt()</h3>
2569
+ <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">value</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">JsonValue</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">key</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">QueryConstraint</span><span style="color:#ABB2BF">;</span></span></code></pre>
2570
+ <p><code>startAt(value, key?)</code> — INCLUSIVE lower bound under the active
2571
+ ordering. Optional <code>key</code> is the tie-breaker when ordering by
2572
+ child/value and multiple children share the bound’s value.</p>
2573
+ <h4 id="parameters-61">Parameters</h4>
2574
+ <div class="table-scroll">
2575
+
2576
+
2577
+
2578
+
2579
+
2580
+
2581
+
2582
+
2583
+
2584
+
2585
+
2586
+
2587
+
2588
+
2589
+
2590
+
2591
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>value</code></td><td align="left"><a href="#jsonvalue"><code>JsonValue</code></a></td></tr><tr><td align="left"><code>key?</code></td><td align="left"><code>string</code></td></tr></tbody></table></div>
2592
+ <h4 id="returns-99">Returns</h4>
2593
+ <p><a href="#queryconstraint"><code>QueryConstraint</code></a></p>
2594
+ <hr>
2595
+ <p><a id="update-2"></a></p>
2596
+ <h3 id="update-1">update()</h3>
2597
+ <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"> update</span><span style="color:#ABB2BF">(</span><span style="color:#E06C75;font-style:italic">r</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">DatabaseReference</span><span style="color:#ABB2BF">, </span><span style="color:#E06C75;font-style:italic">values</span><span style="color:#ABB2BF">: </span><span style="color:#E5C07B">Record</span><span style="color:#ABB2BF">&#x3C;</span><span style="color:#E5C07B">string</span><span style="color:#ABB2BF">, </span><span style="color:#E5C07B">unknown</span><span style="color:#ABB2BF">>): </span><span style="color:#E5C07B">Promise</span><span style="color:#ABB2BF">&#x3C;</span><span style="color:#E5C07B">void</span><span style="color:#ABB2BF">>;</span></span></code></pre>
2598
+ <p><code>update(ref, values)</code> — partial update.</p>
2599
+ <ul>
2600
+ <li>When <code>values</code> keys contain <code>/</code>, the call is a <strong>multi-path atomic
2601
+ update</strong>: every listed path is written as one transaction (any
2602
+ denial fails the whole batch).</li>
2603
+ <li>Otherwise it’s a <strong>shallow merge</strong> at the ref’s path: each
2604
+ top-level key replaces the corresponding child. <code>null</code> values
2605
+ delete.</li>
2606
+ </ul>
2607
+ <p>Both behaviors are sandbox-implemented per the RtdbBackend’s
2608
+ <code>update</code> method (<code>rtdb-modular</code>-spec atomic claim, matrix row #23).</p>
2609
+ <h4 id="parameters-62">Parameters</h4>
2610
+ <div class="table-scroll">
2611
+
2612
+
2613
+
2614
+
2615
+
2616
+
2617
+
2618
+
2619
+
2620
+
2621
+
2622
+
2623
+
2624
+
2625
+
2626
+
2627
+ <table><thead><tr><th align="left">Parameter</th><th align="left">Type</th></tr></thead><tbody><tr><td align="left"><code>r</code></td><td align="left"><a href="#databasereference"><code>DatabaseReference</code></a></td></tr><tr><td align="left"><code>values</code></td><td align="left"><code>Record</code>&#x3C;<code>string</code>, <code>unknown</code>></td></tr></tbody></table></div>
2628
+ <h4 id="returns-100">Returns</h4>
2629
+ <p><code>Promise</code>&#x3C;<code>void</code>></p>
2630
+ <h2 id="references">References</h2>
2631
+ <p><a id="authstate"></a></p>
2632
+ <h3 id="authstate">AuthState</h3>
2633
+ <p>Re-exports <a href="/docs/pyric-firestore-reference-api/#authstate">AuthState</a></p>
2634
+ <hr>
2635
+ <p><a id="sandbox-1"></a></p>
2636
+ <h3 id="sandbox-1">Sandbox</h3>
2637
+ <p>Re-exports <a href="/docs/pyric-firestore-reference-api/#sandbox">Sandbox</a></p>
2638
+ <hr>
2639
+ <p><a id="sandboxcontext"></a></p>
2640
+ <h3 id="sandboxcontext">SandboxContext</h3>
2641
+ <p>Re-exports <a href="/docs/pyric-firestore-reference-api/#sandboxcontext">SandboxContext</a></p> </article> </main> <aside class="doc-toc api-symbols" aria-label="API symbols" data-astro-cid-mw7aashj> <h2 class="doc-toc-heading" data-astro-cid-mw7aashj>Symbols</h2> <input class="api-symbol-filter" type="search" placeholder="Filter symbols" aria-label="Filter API symbols" data-api-symbol-filter data-astro-cid-mw7aashj> <div class="api-symbol-groups" data-api-symbol-groups data-astro-cid-mw7aashj> <section class="api-symbol-group" data-api-symbol-group data-astro-cid-mw7aashj> <a class="api-symbol-kind" href="#classes" data-astro-cid-mw7aashj> Classes </a> <ul data-astro-cid-mw7aashj> <li data-api-symbol="database" data-astro-cid-mw7aashj> <a href="#database" data-astro-cid-mw7aashj>Database</a> </li><li data-api-symbol="datasnapshot" data-astro-cid-mw7aashj> <a href="#datasnapshot" data-astro-cid-mw7aashj>DataSnapshot</a> </li><li data-api-symbol="ondisconnect" data-astro-cid-mw7aashj> <a href="#ondisconnect" data-astro-cid-mw7aashj>OnDisconnect</a> </li><li data-api-symbol="queryconstraint" data-astro-cid-mw7aashj> <a href="#queryconstraint" data-astro-cid-mw7aashj>QueryConstraint</a> </li><li data-api-symbol="transactionresult" data-astro-cid-mw7aashj> <a href="#transactionresult" data-astro-cid-mw7aashj>TransactionResult</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group data-astro-cid-mw7aashj> <a class="api-symbol-kind" href="#interfaces" data-astro-cid-mw7aashj> Interfaces </a> <ul data-astro-cid-mw7aashj> <li data-api-symbol="databasereference" data-astro-cid-mw7aashj> <a href="#databasereference" data-astro-cid-mw7aashj>DatabaseReference</a> </li><li data-api-symbol="datasnapshotimplementation" data-astro-cid-mw7aashj> <a href="#datasnapshotimplementation" data-astro-cid-mw7aashj>DataSnapshotImplementation</a> </li><li data-api-symbol="iterateddatasnapshot" data-astro-cid-mw7aashj> <a href="#iterateddatasnapshot" data-astro-cid-mw7aashj>IteratedDataSnapshot</a> </li><li data-api-symbol="listenoptions" data-astro-cid-mw7aashj> <a href="#listenoptions" data-astro-cid-mw7aashj>ListenOptions</a> </li><li data-api-symbol="query" data-astro-cid-mw7aashj> <a href="#query" data-astro-cid-mw7aashj>Query</a> </li><li data-api-symbol="thenablereference" data-astro-cid-mw7aashj> <a href="#thenablereference" data-astro-cid-mw7aashj>ThenableReference</a> </li><li data-api-symbol="transactionoptions" data-astro-cid-mw7aashj> <a href="#transactionoptions" data-astro-cid-mw7aashj>TransactionOptions</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group data-astro-cid-mw7aashj> <a class="api-symbol-kind" href="#type-aliases" data-astro-cid-mw7aashj> Type Aliases </a> <ul data-astro-cid-mw7aashj> <li data-api-symbol="appdatabase" data-astro-cid-mw7aashj> <a href="#appdatabase" data-astro-cid-mw7aashj>AppDatabase</a> </li><li data-api-symbol="emulatormocktokenoptions" data-astro-cid-mw7aashj> <a href="#emulatormocktokenoptions" data-astro-cid-mw7aashj>EmulatorMockTokenOptions</a> </li><li data-api-symbol="eventtype" data-astro-cid-mw7aashj> <a href="#eventtype" data-astro-cid-mw7aashj>EventType</a> </li><li data-api-symbol="jsonvalue" data-astro-cid-mw7aashj> <a href="#jsonvalue" data-astro-cid-mw7aashj>JsonValue</a> </li><li data-api-symbol="queryconstrainttype" data-astro-cid-mw7aashj> <a href="#queryconstrainttype" data-astro-cid-mw7aashj>QueryConstraintType</a> </li><li data-api-symbol="unsubscribe()" data-astro-cid-mw7aashj> <a href="#unsubscribe" data-astro-cid-mw7aashj>Unsubscribe()</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group data-astro-cid-mw7aashj> <a class="api-symbol-kind" href="#variables" data-astro-cid-mw7aashj> Variables </a> <ul data-astro-cid-mw7aashj> <li data-api-symbol="constraint_symbol" data-astro-cid-mw7aashj> <a href="#constraint_symbol" data-astro-cid-mw7aashj>CONSTRAINT_SYMBOL</a> </li><li data-api-symbol="query_symbol" data-astro-cid-mw7aashj> <a href="#query_symbol" data-astro-cid-mw7aashj>QUERY_SYMBOL</a> </li><li data-api-symbol="sandbox" data-astro-cid-mw7aashj> <a href="#sandbox" data-astro-cid-mw7aashj>sandbox</a> </li><li data-api-symbol="target_symbol" data-astro-cid-mw7aashj> <a href="#target_symbol" data-astro-cid-mw7aashj>TARGET_SYMBOL</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group data-astro-cid-mw7aashj> <a class="api-symbol-kind" href="#functions" data-astro-cid-mw7aashj> Functions </a> <ul data-astro-cid-mw7aashj> <li data-api-symbol="buildsandboxref()" data-astro-cid-mw7aashj> <a href="#buildsandboxref" data-astro-cid-mw7aashj>buildSandboxRef()</a> </li><li data-api-symbol="child()" data-astro-cid-mw7aashj> <a href="#child-3" data-astro-cid-mw7aashj>child()</a> </li><li data-api-symbol="connectdatabaseemulator()" data-astro-cid-mw7aashj> <a href="#connectdatabaseemulator" data-astro-cid-mw7aashj>connectDatabaseEmulator()</a> </li><li data-api-symbol="enablelogging()" data-astro-cid-mw7aashj> <a href="#enablelogging" data-astro-cid-mw7aashj>enableLogging()</a> </li><li data-api-symbol="endat()" data-astro-cid-mw7aashj> <a href="#endat" data-astro-cid-mw7aashj>endAt()</a> </li><li data-api-symbol="endbefore()" data-astro-cid-mw7aashj> <a href="#endbefore" data-astro-cid-mw7aashj>endBefore()</a> </li><li data-api-symbol="equalto()" data-astro-cid-mw7aashj> <a href="#equalto" data-astro-cid-mw7aashj>equalTo()</a> </li><li data-api-symbol="forcelongpolling()" data-astro-cid-mw7aashj> <a href="#forcelongpolling" data-astro-cid-mw7aashj>forceLongPolling()</a> </li><li data-api-symbol="forcewebsockets()" data-astro-cid-mw7aashj> <a href="#forcewebsockets" data-astro-cid-mw7aashj>forceWebSockets()</a> </li><li data-api-symbol="get()" data-astro-cid-mw7aashj> <a href="#get" data-astro-cid-mw7aashj>get()</a> </li><li data-api-symbol="getadmindatabase()" data-astro-cid-mw7aashj> <a href="#getadmindatabase" data-astro-cid-mw7aashj>getAdminDatabase()</a> </li><li data-api-symbol="getdatabase()" data-astro-cid-mw7aashj> <a href="#getdatabase" data-astro-cid-mw7aashj>getDatabase()</a> </li><li data-api-symbol="gooffline()" data-astro-cid-mw7aashj> <a href="#gooffline" data-astro-cid-mw7aashj>goOffline()</a> </li><li data-api-symbol="goonline()" data-astro-cid-mw7aashj> <a href="#goonline" data-astro-cid-mw7aashj>goOnline()</a> </li><li data-api-symbol="increment()" data-astro-cid-mw7aashj> <a href="#increment" data-astro-cid-mw7aashj>increment()</a> </li><li data-api-symbol="limittofirst()" data-astro-cid-mw7aashj> <a href="#limittofirst" data-astro-cid-mw7aashj>limitToFirst()</a> </li><li data-api-symbol="limittolast()" data-astro-cid-mw7aashj> <a href="#limittolast" data-astro-cid-mw7aashj>limitToLast()</a> </li><li data-api-symbol="off()" data-astro-cid-mw7aashj> <a href="#off" data-astro-cid-mw7aashj>off()</a> </li><li data-api-symbol="onchildadded()" data-astro-cid-mw7aashj> <a href="#onchildadded" data-astro-cid-mw7aashj>onChildAdded()</a> </li><li data-api-symbol="onchildchanged()" data-astro-cid-mw7aashj> <a href="#onchildchanged" data-astro-cid-mw7aashj>onChildChanged()</a> </li><li data-api-symbol="onchildmoved()" data-astro-cid-mw7aashj> <a href="#onchildmoved" data-astro-cid-mw7aashj>onChildMoved()</a> </li><li data-api-symbol="onchildremoved()" data-astro-cid-mw7aashj> <a href="#onchildremoved" data-astro-cid-mw7aashj>onChildRemoved()</a> </li><li data-api-symbol="ondisconnect()" data-astro-cid-mw7aashj> <a href="#ondisconnect-1" data-astro-cid-mw7aashj>onDisconnect()</a> </li><li data-api-symbol="onvalue()" data-astro-cid-mw7aashj> <a href="#onvalue" data-astro-cid-mw7aashj>onValue()</a> </li><li data-api-symbol="orderbychild()" data-astro-cid-mw7aashj> <a href="#orderbychild" data-astro-cid-mw7aashj>orderByChild()</a> </li><li data-api-symbol="orderbykey()" data-astro-cid-mw7aashj> <a href="#orderbykey" data-astro-cid-mw7aashj>orderByKey()</a> </li><li data-api-symbol="orderbypriority()" data-astro-cid-mw7aashj> <a href="#orderbypriority" data-astro-cid-mw7aashj>orderByPriority()</a> </li><li data-api-symbol="orderbyvalue()" data-astro-cid-mw7aashj> <a href="#orderbyvalue" data-astro-cid-mw7aashj>orderByValue()</a> </li><li data-api-symbol="push()" data-astro-cid-mw7aashj> <a href="#push" data-astro-cid-mw7aashj>push()</a> </li><li data-api-symbol="pushkey()" data-astro-cid-mw7aashj> <a href="#pushkey" data-astro-cid-mw7aashj>pushKey()</a> </li><li data-api-symbol="query()" data-astro-cid-mw7aashj> <a href="#query-1" data-astro-cid-mw7aashj>query()</a> </li><li data-api-symbol="ref()" data-astro-cid-mw7aashj> <a href="#ref" data-astro-cid-mw7aashj>ref()</a> </li><li data-api-symbol="reffromurl()" data-astro-cid-mw7aashj> <a href="#reffromurl" data-astro-cid-mw7aashj>refFromURL()</a> </li><li data-api-symbol="remove()" data-astro-cid-mw7aashj> <a href="#remove-1" data-astro-cid-mw7aashj>remove()</a> </li><li data-api-symbol="runtransaction()" data-astro-cid-mw7aashj> <a href="#runtransaction" data-astro-cid-mw7aashj>runTransaction()</a> </li><li data-api-symbol="servertimestamp()" data-astro-cid-mw7aashj> <a href="#servertimestamp" data-astro-cid-mw7aashj>serverTimestamp()</a> </li><li data-api-symbol="set()" data-astro-cid-mw7aashj> <a href="#set-1" data-astro-cid-mw7aashj>set()</a> </li><li data-api-symbol="setpriority()" data-astro-cid-mw7aashj> <a href="#setpriority" data-astro-cid-mw7aashj>setPriority()</a> </li><li data-api-symbol="setwithpriority()" data-astro-cid-mw7aashj> <a href="#setwithpriority-1" data-astro-cid-mw7aashj>setWithPriority()</a> </li><li data-api-symbol="startafter()" data-astro-cid-mw7aashj> <a href="#startafter" data-astro-cid-mw7aashj>startAfter()</a> </li><li data-api-symbol="startat()" data-astro-cid-mw7aashj> <a href="#startat" data-astro-cid-mw7aashj>startAt()</a> </li><li data-api-symbol="update()" data-astro-cid-mw7aashj> <a href="#update-1" data-astro-cid-mw7aashj>update()</a> </li> </ul> </section><section class="api-symbol-group" data-api-symbol-group data-astro-cid-mw7aashj> <a class="api-symbol-kind" href="#references" data-astro-cid-mw7aashj> References </a> <ul data-astro-cid-mw7aashj> <li data-api-symbol="authstate" data-astro-cid-mw7aashj> <a href="#authstate" data-astro-cid-mw7aashj>AuthState</a> </li><li data-api-symbol="sandbox" data-astro-cid-mw7aashj> <a href="#sandbox-1" data-astro-cid-mw7aashj>Sandbox</a> </li><li data-api-symbol="sandboxcontext" data-astro-cid-mw7aashj> <a href="#sandboxcontext" data-astro-cid-mw7aashj>SandboxContext</a> </li> </ul> </section> <p class="api-symbol-empty" data-api-symbol-empty hidden data-astro-cid-mw7aashj>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>