Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 3190c28

Browse files
Realtime database Transaction Implementation #1118
1 parent 9ef5df7 commit 3190c28

1 file changed

Lines changed: 27 additions & 13 deletions

File tree

src/firebase.d.ts

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export enum LogComplexEventTypeParameter {
4848
ARRAY,
4949
BOOLEAN
5050
}
51+
5152
/**
5253
* The allowed values for QueryOptions.orderBy.type.
5354
*/
@@ -519,30 +520,43 @@ export function init(options?: InitOptions): Promise<any>;
519520
// Database
520521
export interface OnDisconnect {
521522
cancel(): Promise<any>;
523+
522524
remove(): Promise<any>;
525+
523526
set(value: any): Promise<any>;
527+
524528
setWithPriority(
525529
value: any,
526530
priority: number | string
527531
): Promise<any>;
532+
528533
update(values: Object): Promise<any>;
529534
}
535+
530536
export interface DataSnapshot {
531-
key: string,
532-
ref: any, // TODO: Type it so that it returns a databaseReference.
533-
child(path: string): DataSnapshot,
534-
exists(): boolean,
535-
forEach(action: (snapshot: DataSnapshot) => any) : boolean,
536-
getPriority(): string | number | null,
537-
hasChild(path: string): boolean,
538-
hasChildren(): boolean,
539-
numChildren(): number,
540-
toJSON(): Object,
541-
val(): any
542-
};
537+
key: string;
538+
ref: any; // TODO: Type it so that it returns a databaseReference.
539+
child(path: string): DataSnapshot;
540+
541+
exists(): boolean;
542+
543+
forEach(action: (snapshot: DataSnapshot) => any): boolean;
544+
545+
getPriority(): string | number | null;
546+
547+
hasChild(path: string): boolean;
548+
549+
hasChildren(): boolean;
550+
551+
numChildren(): number;
552+
553+
toJSON(): Object;
554+
555+
val(): any;
556+
}
543557

544558
export function transaction(path: string, transactionUpdate: (a: any) => any,
545-
onComplete?: (error: Error | null, committed: boolean, dataSnapshot: DataSnapshot) => any): Promise<any>;
559+
onComplete?: (error: Error | null, committed: boolean, dataSnapshot: DataSnapshot) => any): Promise<any>;
546560

547561
export function push(path: string, value: any): Promise<PushResult>;
548562

0 commit comments

Comments
 (0)