@firebase/database 0.14.4 → 1.0.0-20230706224113

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.
@@ -139,7 +139,7 @@ export declare class DataSnapshot {
139
139
  */
140
140
  exportVal(): any;
141
141
  /**
142
- * Enumerates the top-level children in the `DataSnapshot`.
142
+ * Enumerates the top-level children in the `IteratedDataSnapshot`.
143
143
  *
144
144
  * Because of the way JavaScript objects work, the ordering of data in the
145
145
  * JavaScript object returned by `val()` is not guaranteed to match the
@@ -156,7 +156,7 @@ export declare class DataSnapshot {
156
156
  * @returns true if enumeration was canceled due to your callback returning
157
157
  * true.
158
158
  */
159
- forEach(action: (child: DataSnapshot) => boolean | void): boolean;
159
+ forEach(action: (child: IteratedDataSnapshot) => boolean | void): boolean;
160
160
  /**
161
161
  * Returns true if the specified child path has (non-null) data.
162
162
  *
@@ -195,6 +195,12 @@ export declare class DataSnapshot {
195
195
  */
196
196
  val(): any;
197
197
  }
198
+ /**
199
+ * Represents a child snapshot of a `Reference` that is being iterated over. The key will never be undefined.
200
+ */
201
+ export interface IteratedDataSnapshot extends DataSnapshot {
202
+ key: string;
203
+ }
198
204
  /**
199
205
  *
200
206
  * Returns a `Reference` representing the location in the Database
@@ -17,7 +17,7 @@
17
17
  export { Database, EmulatorMockTokenOptions, enableLogging, goOffline, goOnline, forceWebSockets, forceLongPolling, connectDatabaseEmulator } from './api/Database';
18
18
  export { Query, DatabaseReference, ListenOptions, Unsubscribe, ThenableReference } from './api/Reference';
19
19
  export { OnDisconnect } from './api/OnDisconnect';
20
- export { DataSnapshot, EventType, QueryConstraint, QueryConstraintType, endAt, endBefore, equalTo, get, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, set, setPriority, setWithPriority, startAfter, startAt, update, child } from './api/Reference_impl';
20
+ export { DataSnapshot, EventType, IteratedDataSnapshot, QueryConstraint, QueryConstraintType, endAt, endBefore, equalTo, get, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, set, setPriority, setWithPriority, startAfter, startAt, update, child } from './api/Reference_impl';
21
21
  export { increment, serverTimestamp } from './api/ServerValue';
22
22
  export { runTransaction, TransactionOptions, TransactionResult } from './api/Transaction';
23
23
  export { setSDKVersion as _setSDKVersion } from './core/version';
package/dist/private.d.ts CHANGED
@@ -320,7 +320,7 @@ export declare class DataSnapshot {
320
320
  */
321
321
  exportVal(): any;
322
322
  /**
323
- * Enumerates the top-level children in the `DataSnapshot`.
323
+ * Enumerates the top-level children in the `IteratedDataSnapshot`.
324
324
  *
325
325
  * Because of the way JavaScript objects work, the ordering of data in the
326
326
  * JavaScript object returned by `val()` is not guaranteed to match the
@@ -337,7 +337,7 @@ export declare class DataSnapshot {
337
337
  * @returns true if enumeration was canceled due to your callback returning
338
338
  * true.
339
339
  */
340
- forEach(action: (child: DataSnapshot) => boolean | void): boolean;
340
+ forEach(action: (child: IteratedDataSnapshot) => boolean | void): boolean;
341
341
  /**
342
342
  * Returns true if the specified child path has (non-null) data.
343
343
  *
@@ -765,6 +765,13 @@ declare abstract class Index {
765
765
  abstract toString(): string;
766
766
  }
767
767
 
768
+ /**
769
+ * Represents a child snapshot of a `Reference` that is being iterated over. The key will never be undefined.
770
+ */
771
+ export declare interface IteratedDataSnapshot extends DataSnapshot {
772
+ key: string;
773
+ }
774
+
768
775
  /**
769
776
  * Creates a new `QueryConstraint` that if limited to the first specific number
770
777
  * of children.
package/dist/public.d.ts CHANGED
@@ -142,7 +142,7 @@ export declare class DataSnapshot {
142
142
  */
143
143
  exportVal(): any;
144
144
  /**
145
- * Enumerates the top-level children in the `DataSnapshot`.
145
+ * Enumerates the top-level children in the `IteratedDataSnapshot`.
146
146
  *
147
147
  * Because of the way JavaScript objects work, the ordering of data in the
148
148
  * JavaScript object returned by `val()` is not guaranteed to match the
@@ -159,7 +159,7 @@ export declare class DataSnapshot {
159
159
  * @returns true if enumeration was canceled due to your callback returning
160
160
  * true.
161
161
  */
162
- forEach(action: (child: DataSnapshot) => boolean | void): boolean;
162
+ forEach(action: (child: IteratedDataSnapshot) => boolean | void): boolean;
163
163
  /**
164
164
  * Returns true if the specified child path has (non-null) data.
165
165
  *
@@ -359,6 +359,12 @@ export declare function goOnline(db: Database): void;
359
359
  * @returns A placeholder value for modifying data atomically server-side.
360
360
  */
361
361
  export declare function increment(delta: number): object;
362
+ /**
363
+ * Represents a child snapshot of a `Reference` that is being iterated over. The key will never be undefined.
364
+ */
365
+ export declare interface IteratedDataSnapshot extends DataSnapshot {
366
+ key: string;
367
+ }
362
368
  /**
363
369
  * Creates a new `QueryConstraint` that if limited to the first specific number
364
370
  * of children.
@@ -139,7 +139,7 @@ export declare class DataSnapshot {
139
139
  */
140
140
  exportVal(): any;
141
141
  /**
142
- * Enumerates the top-level children in the `DataSnapshot`.
142
+ * Enumerates the top-level children in the `IteratedDataSnapshot`.
143
143
  *
144
144
  * Because of the way JavaScript objects work, the ordering of data in the
145
145
  * JavaScript object returned by `val()` is not guaranteed to match the
@@ -156,7 +156,7 @@ export declare class DataSnapshot {
156
156
  * @returns true if enumeration was canceled due to your callback returning
157
157
  * true.
158
158
  */
159
- forEach(action: (child: DataSnapshot) => boolean | void): boolean;
159
+ forEach(action: (child: IteratedDataSnapshot) => boolean | void): boolean;
160
160
  /**
161
161
  * Returns true if the specified child path has (non-null) data.
162
162
  *
@@ -195,6 +195,12 @@ export declare class DataSnapshot {
195
195
  */
196
196
  val(): any;
197
197
  }
198
+ /**
199
+ * Represents a child snapshot of a `Reference` that is being iterated over. The key will never be undefined.
200
+ */
201
+ export interface IteratedDataSnapshot extends DataSnapshot {
202
+ key: string;
203
+ }
198
204
  /**
199
205
  *
200
206
  * Returns a `Reference` representing the location in the Database
@@ -17,7 +17,7 @@
17
17
  export { Database, EmulatorMockTokenOptions, enableLogging, goOffline, goOnline, forceWebSockets, forceLongPolling, connectDatabaseEmulator } from './api/Database';
18
18
  export { Query, DatabaseReference, ListenOptions, Unsubscribe, ThenableReference } from './api/Reference';
19
19
  export { OnDisconnect } from './api/OnDisconnect';
20
- export { DataSnapshot, EventType, QueryConstraint, QueryConstraintType, endAt, endBefore, equalTo, get, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, set, setPriority, setWithPriority, startAfter, startAt, update, child } from './api/Reference_impl';
20
+ export { DataSnapshot, EventType, IteratedDataSnapshot, QueryConstraint, QueryConstraintType, endAt, endBefore, equalTo, get, limitToFirst, limitToLast, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, push, query, ref, refFromURL, remove, set, setPriority, setWithPriority, startAfter, startAt, update, child } from './api/Reference_impl';
21
21
  export { increment, serverTimestamp } from './api/ServerValue';
22
22
  export { runTransaction, TransactionOptions, TransactionResult } from './api/Transaction';
23
23
  export { setSDKVersion as _setSDKVersion } from './core/version';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/database",
3
- "version": "0.14.4",
3
+ "version": "1.0.0-20230706224113",
4
4
  "description": "",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.node.cjs.js",
@@ -57,7 +57,7 @@
57
57
  "tslib": "^2.1.0"
58
58
  },
59
59
  "devDependencies": {
60
- "@firebase/app": "0.9.4",
60
+ "@firebase/app": "0.9.13",
61
61
  "rollup": "2.79.1",
62
62
  "rollup-plugin-typescript2": "0.31.2",
63
63
  "typescript": "4.7.4"