Skip to content

Commit bc54056

Browse files
Fix undocumented docs
1 parent 925409c commit bc54056

File tree

5 files changed

+20
-13
lines changed

5 files changed

+20
-13
lines changed

common/api-review/database-exp.api.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export class DataSnapshot {
1616
hasChildren(): boolean;
1717
get key(): string | null;
1818
get priority(): string | number | null;
19-
// (undocumented)
2019
readonly ref: Reference;
2120
get size(): number;
2221
toJSON(): object | null;
@@ -43,9 +42,7 @@ export type EventType = 'value' | 'child_added' | 'child_changed' | 'child_moved
4342

4443
// @public
4544
export class FirebaseDatabase {
46-
// (undocumented)
4745
readonly app: FirebaseApp;
48-
// (undocumented)
4946
readonly 'type' = "database";
5047
}
5148

@@ -215,14 +212,10 @@ export interface TransactionOptions {
215212
readonly applyLocally?: boolean;
216213
}
217214

218-
// @public (undocumented)
215+
// @public
219216
export class TransactionResult {
220-
constructor(committed: boolean, snapshot: DataSnapshot);
221-
// (undocumented)
222217
readonly committed: boolean;
223-
// (undocumented)
224218
readonly snapshot: DataSnapshot;
225-
// (undocumented)
226219
toJSON(): object;
227220
}
228221

packages/database/src/api/Reference.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ import { runTransaction } from '../exp/Transaction';
7272
import { Database } from './Database';
7373
import { OnDisconnect } from './onDisconnect';
7474
import { TransactionResult } from './TransactionResult';
75+
7576
/**
7677
* Class representing a firebase data snapshot. It wraps a SnapshotNode and
7778
* surfaces the public methods (val, forEach, etc.) we want to expose.

packages/database/src/exp/Database.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ export function repoManagerForceRestClient(forceRestClient: boolean): void {
200200
* Class representing a Firebase Realtime Database.
201201
*/
202202
export class FirebaseDatabase implements _FirebaseService {
203+
/** Represents a database instance. */
203204
readonly 'type' = 'database';
204205

205206
/** Track if the instance has been used (root or repo accessed) */
@@ -209,7 +210,11 @@ export class FirebaseDatabase implements _FirebaseService {
209210
private _rootInternal?: ReferenceImpl;
210211

211212
/** @hideconstructor */
212-
constructor(private _repoInternal: Repo, readonly app: FirebaseApp) {}
213+
constructor(
214+
private _repoInternal: Repo,
215+
/** The FirebaseApp associated with this Realtime Database instance. */
216+
readonly app: FirebaseApp
217+
) {}
213218

214219
get _repo(): Repo {
215220
if (!this._instanceStarted) {

packages/database/src/exp/Reference_impl.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ export class DataSnapshot {
289289
*/
290290
constructor(
291291
readonly _node: Node,
292+
/** The location of this DataSnapshot. */
292293
readonly ref: ReferenceImpl,
293294
readonly _index: Index
294295
) {}

packages/database/src/exp/Transaction.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,19 @@ export interface TransactionOptions {
3636
readonly applyLocally?: boolean;
3737
}
3838

39+
/**
40+
* A type for the resolve value of Firebase.transaction.
41+
*/
3942
export class TransactionResult {
40-
/**
41-
* A type for the resolve value of Firebase.transaction.
42-
*/
43-
constructor(readonly committed: boolean, readonly snapshot: DataSnapshot) {}
43+
/** @hideconstructor */
44+
constructor(
45+
/** Whether the transaction was successfully committed. */
46+
readonly committed: boolean,
47+
/** The resulting data snapshot. */
48+
readonly snapshot: DataSnapshot
49+
) {}
4450

51+
/** Returns a JSON-serializable representation of this object. */
4552
toJSON(): object {
4653
return { committed: this.committed, snapshot: this.snapshot.toJSON() };
4754
}

0 commit comments

Comments
 (0)