Type Aliases
RtdbRulesJson
type RtdbRulesJson = {
rules: Record<string, unknown>;
};
Properties
Functions
getActiveRules()
function getActiveRules(sandbox: LocalSandbox): RtdbRulesJson;
Read the currently active rules as detached JSON.
Parameters
| Parameter | Type |
|---|---|
sandbox | LocalSandbox |
Returns
setData()
function setData(sandbox: LocalSandbox, data: Record<string, unknown>): void;
Replace RTDB data in bulk without applying security rules.
Parameters
| Parameter | Type |
|---|---|
sandbox | LocalSandbox |
data | Record<string, unknown> |
Returns
void
setRules()
function setRules(sandbox: LocalSandbox, rules: RtdbRulesJson): void;
Replace the active RTDB rules. Pass null to restore default allow.
Parameters
| Parameter | Type |
|---|---|
sandbox | LocalSandbox |
rules | RtdbRulesJson |
Returns
void
snapshotState()
function snapshotState(sandbox: LocalSandbox): JsonValue;
Snapshot the complete RTDB tree without applying security rules.
Parameters
| Parameter | Type |
|---|---|
sandbox | LocalSandbox |
Returns
stripJsonComments()
function stripJsonComments(text: string): string;
Strip JavaScript-style line comments (//...) and block comments (/*...*/)
from JSON source text without altering string literals. Realtime Database
rules files permit comment blocks, requiring pre-processing before evaluation.
Parameters
| Parameter | Type |
|---|---|
text | string |
Returns
string