Skip to content

Commit 0e600b3

Browse files
committed
Ran docgen devsite
1 parent dab20d3 commit 0e600b3

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

docs-devsite/database.datasnapshot.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export declare class DataSnapshot
3838
| [child(path)](./database.datasnapshot.md#datasnapshotchild) | | Gets another <code>DataSnapshot</code> for the location at the specified relative path.<!-- -->Passing a relative path to the <code>child()</code> method of a DataSnapshot returns another <code>DataSnapshot</code> for the location at the specified relative path. The relative path can either be a simple child name (for example, "ada") or a deeper, slash-separated path (for example, "ada/name/first"). If the child location has no data, an empty <code>DataSnapshot</code> (that is, a <code>DataSnapshot</code> whose value is <code>null</code>) is returned. |
3939
| [exists()](./database.datasnapshot.md#datasnapshotexists) | | Returns true if this <code>DataSnapshot</code> contains any data. It is slightly more efficient than using <code>snapshot.val() !== null</code>. |
4040
| [exportVal()](./database.datasnapshot.md#datasnapshotexportval) | | Exports the entire contents of the DataSnapshot as a JavaScript object.<!-- -->The <code>exportVal()</code> method is similar to <code>val()</code>, except priority information is included (if available), making it suitable for backing up your data. |
41-
| [forEach(action)](./database.datasnapshot.md#datasnapshotforeach) | | Enumerates the top-level children in the <code>DataSnapshot</code>.<!-- -->Because of the way JavaScript objects work, the ordering of data in the JavaScript object returned by <code>val()</code> is not guaranteed to match the ordering on the server nor the ordering of <code>onChildAdded()</code> events. That is where <code>forEach()</code> comes in handy. It guarantees the children of a <code>DataSnapshot</code> will be iterated in their query order.<!-- -->If no explicit <code>orderBy*()</code> method is used, results are returned ordered by key (unless priorities are used, in which case, results are returned by priority). |
41+
| [forEach(action)](./database.datasnapshot.md#datasnapshotforeach) | | Enumerates the top-level children in the <code>IteratedDataSnapshot</code>.<!-- -->Because of the way JavaScript objects work, the ordering of data in the JavaScript object returned by <code>val()</code> is not guaranteed to match the ordering on the server nor the ordering of <code>onChildAdded()</code> events. That is where <code>forEach()</code> comes in handy. It guarantees the children of a <code>DataSnapshot</code> will be iterated in their query order.<!-- -->If no explicit <code>orderBy*()</code> method is used, results are returned ordered by key (unless priorities are used, in which case, results are returned by priority). |
4242
| [hasChild(path)](./database.datasnapshot.md#datasnapshothaschild) | | Returns true if the specified child path has (non-null) data. |
4343
| [hasChildren()](./database.datasnapshot.md#datasnapshothaschildren) | | Returns whether or not the <code>DataSnapshot</code> has any non-<code>null</code> child properties.<!-- -->You can use <code>hasChildren()</code> to determine if a <code>DataSnapshot</code> has any children. If it does, you can enumerate them using <code>forEach()</code>. If it doesn't, then either this snapshot contains a primitive value (which can be retrieved with <code>val()</code>) or it is empty (in which case, <code>val()</code> will return <code>null</code>). |
4444
| [toJSON()](./database.datasnapshot.md#datasnapshottojson) | | Returns a JSON-serializable representation of this object. |
@@ -142,7 +142,7 @@ The DataSnapshot's contents as a JavaScript value (Object, Array, string, number
142142

143143
## DataSnapshot.forEach()
144144

145-
Enumerates the top-level children in the `DataSnapshot`<!-- -->.
145+
Enumerates the top-level children in the `IteratedDataSnapshot`<!-- -->.
146146

147147
Because of the way JavaScript objects work, the ordering of data in the JavaScript object returned by `val()` is not guaranteed to match the ordering on the server nor the ordering of `onChildAdded()` events. That is where `forEach()` comes in handy. It guarantees the children of a `DataSnapshot` will be iterated in their query order.
148148

@@ -151,14 +151,14 @@ If no explicit `orderBy*()` method is used, results are returned ordered by key
151151
<b>Signature:</b>
152152

153153
```typescript
154-
forEach(action: (child: DataSnapshot) => boolean | void): boolean;
154+
forEach(action: (child: IteratedDataSnapshot) => boolean | void): boolean;
155155
```
156156

157157
### Parameters
158158

159159
| Parameter | Type | Description |
160160
| --- | --- | --- |
161-
| action | (child: [DataSnapshot](./database.datasnapshot.md#datasnapshot_class)<!-- -->) =&gt; boolean \| void | A function that will be called for each child DataSnapshot. The callback can return true to cancel further enumeration. |
161+
| action | (child: [IteratedDataSnapshot](./database.iterateddatasnapshot.md#iterateddatasnapshot_interface)<!-- -->) =&gt; boolean \| void | A function that will be called for each child DataSnapshot. The callback can return true to cancel further enumeration. |
162162

163163
<b>Returns:</b>
164164

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Project: /docs/reference/js/_project.yaml
2+
Book: /docs/reference/_book.yaml
3+
page_type: reference
4+
5+
{% comment %}
6+
DO NOT EDIT THIS FILE!
7+
This is generated by the JS SDK team, and any local changes will be
8+
overwritten. Changes should be made in the source code at
9+
https://github.com/firebase/firebase-js-sdk
10+
{% endcomment %}
11+
12+
# IteratedDataSnapshot interface
13+
Represents a child snapshot of a `Reference` that is being iterated over. The key will never be undefined.
14+
15+
<b>Signature:</b>
16+
17+
```typescript
18+
export declare interface IteratedDataSnapshot extends DataSnapshot
19+
```
20+
<b>Extends:</b> [DataSnapshot](./database.datasnapshot.md#datasnapshot_class)
21+
22+
## Properties
23+
24+
| Property | Type | Description |
25+
| --- | --- | --- |
26+
| [key](./database.iterateddatasnapshot.md#iterateddatasnapshotkey) | string | |
27+
28+
## IteratedDataSnapshot.key
29+
30+
<b>Signature:</b>
31+
32+
```typescript
33+
key: string;
34+
```

docs-devsite/database.md

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ Firebase Realtime Database
9494
| Interface | Description |
9595
| --- | --- |
9696
| [DatabaseReference](./database.databasereference.md#databasereference_interface) | A <code>DatabaseReference</code> represents a specific location in your Database and can be used for reading or writing data to that Database location.<!-- -->You can reference the root or child location in your Database by calling <code>ref()</code> or <code>ref(&quot;child/path&quot;)</code>.<!-- -->Writing is done with the <code>set()</code> method and reading can be done with the <code>on*()</code> method. See [https://firebase.google.com/docs/database/web/read-and-write](https://firebase.google.com/docs/database/web/read-and-write) |
97+
| [IteratedDataSnapshot](./database.iterateddatasnapshot.md#iterateddatasnapshot_interface) | Represents a child snapshot of a <code>Reference</code> that is being iterated over. The key will never be undefined. |
9798
| [ListenOptions](./database.listenoptions.md#listenoptions_interface) | An options objects that can be used to customize a listener. |
9899
| [Query](./database.query.md#query_interface) | A <code>Query</code> sorts and filters the data at a Database location so only a subset of the child data is included. This can be used to order a collection of data by some attribute (for example, height of dinosaurs) as well as to restrict a large list of items (for example, chat messages) down to a number suitable for synchronizing to the client. Queries are created by chaining together one or more of the filter methods defined here.<!-- -->Just as with a <code>DatabaseReference</code>, you can receive data from a <code>Query</code> by using the <code>on*()</code> methods. You will only receive events and <code>DataSnapshot</code>s for the subset of the data that matches your query.<!-- -->See [https://firebase.google.com/docs/database/web/lists-of-data\#sorting\_and\_filtering\_data](https://firebase.google.com/docs/database/web/lists-of-data#sorting_and_filtering_data) for more information. |
99100
| [ThenableReference](./database.thenablereference.md#thenablereference_interface) | A <code>Promise</code> that can also act as a <code>DatabaseReference</code> when returned by [push()](./database.md#push)<!-- -->. The reference is available immediately and the <code>Promise</code> resolves as the write to the backend completes. |

0 commit comments

Comments
 (0)