Skip to content

Fixed docgen docsite #7420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs-devsite/database.datasnapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export declare class DataSnapshot
| [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. |
| [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>. |
| [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. |
| [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). |
| [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). |
| [hasChild(path)](./database.datasnapshot.md#datasnapshothaschild) | | Returns true if the specified child path has (non-null) data. |
| [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>). |
| [toJSON()](./database.datasnapshot.md#datasnapshottojson) | | Returns a JSON-serializable representation of this object. |
Expand Down Expand Up @@ -142,7 +142,7 @@ The DataSnapshot's contents as a JavaScript value (Object, Array, string, number

## DataSnapshot.forEach()

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

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.

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

```typescript
forEach(action: (child: DataSnapshot) => boolean | void): boolean;
forEach(action: (child: IteratedDataSnapshot) => boolean | void): boolean;
```

### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| 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. |
| 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. |

<b>Returns:</b>

Expand Down
34 changes: 34 additions & 0 deletions docs-devsite/database.iterateddatasnapshot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Project: /docs/reference/js/_project.yaml
Book: /docs/reference/_book.yaml
page_type: reference

{% comment %}
DO NOT EDIT THIS FILE!
This is generated by the JS SDK team, and any local changes will be
overwritten. Changes should be made in the source code at
https://github.com/firebase/firebase-js-sdk
{% endcomment %}

# IteratedDataSnapshot interface
Represents a child snapshot of a `Reference` that is being iterated over. The key will never be undefined.

<b>Signature:</b>

```typescript
export declare interface IteratedDataSnapshot extends DataSnapshot
```
<b>Extends:</b> [DataSnapshot](./database.datasnapshot.md#datasnapshot_class)

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [key](./database.iterateddatasnapshot.md#iterateddatasnapshotkey) | string | |

## IteratedDataSnapshot.key

<b>Signature:</b>

```typescript
key: string;
```
1 change: 1 addition & 0 deletions docs-devsite/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Firebase Realtime Database
| Interface | Description |
| --- | --- |
| [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) |
| [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. |
| [ListenOptions](./database.listenoptions.md#listenoptions_interface) | An options objects that can be used to customize a listener. |
| [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. |
| [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. |
Expand Down