Skip to content

Commit 5120dc8

Browse files
committed
format
1 parent d642e31 commit 5120dc8

File tree

2 files changed

+57
-20
lines changed

2 files changed

+57
-20
lines changed

packages/firebase/compat/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5997,7 +5997,7 @@ declare namespace firebase.database {
59975997
*/
59985998
toJSON(): Object | null;
59995999
}
6000-
6000+
60016001
interface IteratedDataSnapshot extends DataSnapshot {
60026002
key: string; // key of the location of this snapshot.
60036003
}

packages/firestore-types/index.d.ts

Lines changed: 56 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,17 @@ export function setLogLevel(logLevel: LogLevel): void;
5252
export interface FirestoreDataConverter<
5353
AppModelType,
5454
DbModelType extends DocumentData = DocumentData
55-
> {
55+
> {
5656
toFirestore(modelObject: AppModelType): DocumentData;
57-
toFirestore(modelObject: Partial<AppModelType>, options: SetOptions): DocumentData;
57+
toFirestore(
58+
modelObject: Partial<AppModelType>,
59+
options: SetOptions
60+
): DocumentData;
5861

59-
fromFirestore(snapshot: QueryDocumentSnapshot<AppModelType, DbModelType>, options: SnapshotOptions): AppModelType;
62+
fromFirestore(
63+
snapshot: QueryDocumentSnapshot<AppModelType, DbModelType>,
64+
options: SnapshotOptions
65+
): AppModelType;
6066
}
6167

6268
export class FirebaseFirestore {
@@ -213,7 +219,9 @@ export class Transaction {
213219
...moreFieldsAndValues: any[]
214220
): Transaction;
215221

216-
delete<AppModelType, DbModelType extends DocumentData>(documentRef: DocumentReference<AppModelType, DbModelType>): Transaction;
222+
delete<AppModelType, DbModelType extends DocumentData>(
223+
documentRef: DocumentReference<AppModelType, DbModelType>
224+
): Transaction;
217225
}
218226

219227
export class WriteBatch {
@@ -224,17 +232,25 @@ export class WriteBatch {
224232
data: Partial<AppModelType>,
225233
options: SetOptions
226234
): WriteBatch;
227-
set<AppModelType, DbModelType extends DocumentData>(documentRef: DocumentReference<AppModelType, DbModelType>, data: UpdateData): WriteBatch;
235+
set<AppModelType, DbModelType extends DocumentData>(
236+
documentRef: DocumentReference<AppModelType, DbModelType>,
237+
data: UpdateData
238+
): WriteBatch;
228239

229-
update<AppModelType, DbModelType extends DocumentData>(documentRef: DocumentReference<AppModelType, DbModelType>, data: UpdateData): WriteBatch;
240+
update<AppModelType, DbModelType extends DocumentData>(
241+
documentRef: DocumentReference<AppModelType, DbModelType>,
242+
data: UpdateData
243+
): WriteBatch;
230244
update<AppModelType, DbModelType extends DocumentData>(
231245
documentRef: DocumentReference<AppModelType, DbModelType>,
232246
field: string | FieldPath,
233247
value: any,
234248
...moreFieldsAndValues: any[]
235249
): WriteBatch;
236250

237-
delete<AppModelType, DbModelType extends DocumentData>(documentRef: DocumentReference<AppModelType, DbModelType>): WriteBatch;
251+
delete<AppModelType, DbModelType extends DocumentData>(
252+
documentRef: DocumentReference<AppModelType, DbModelType>
253+
): WriteBatch;
238254

239255
commit(): Promise<void>;
240256
}
@@ -276,7 +292,9 @@ export class DocumentReference<AppModelType, DbModelType> {
276292

277293
delete(): Promise<void>;
278294

279-
get(options?: GetOptions): Promise<DocumentSnapshot<AppModelType, DbModelType>>;
295+
get(
296+
options?: GetOptions
297+
): Promise<DocumentSnapshot<AppModelType, DbModelType>>;
280298

281299
onSnapshot(observer: {
282300
next?: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void;
@@ -335,8 +353,10 @@ export class DocumentSnapshot<AppModelType, DbModelType> {
335353
isEqual(other: DocumentSnapshot<AppModelType, DbModelType>): boolean;
336354
}
337355

338-
export class QueryDocumentSnapshot<AppModelType, DbModelType>
339-
extends DocumentSnapshot<AppModelType, DbModelType> {
356+
export class QueryDocumentSnapshot<
357+
AppModelType,
358+
DbModelType
359+
> extends DocumentSnapshot<AppModelType, DbModelType> {
340360
private constructor();
341361

342362
data(options?: SnapshotOptions): AppModelType;
@@ -356,7 +376,10 @@ export type WhereFilterOp =
356376
| 'array-contains-any'
357377
| 'not-in';
358378

359-
export class Query<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>{
379+
export class Query<
380+
AppModelType = DocumentData,
381+
DbModelType extends DocumentData = DocumentData
382+
> {
360383
protected constructor();
361384

362385
readonly firestore: FirebaseFirestore;
@@ -376,16 +399,24 @@ export class Query<AppModelType = DocumentData, DbModelType extends DocumentData
376399

377400
limitToLast(limit: number): Query<AppModelType, DbModelType>;
378401

379-
startAt(snapshot: DocumentSnapshot<AppModelType, DbModelType>): Query<AppModelType, DbModelType>;
402+
startAt(
403+
snapshot: DocumentSnapshot<AppModelType, DbModelType>
404+
): Query<AppModelType, DbModelType>;
380405
startAt(...fieldValues: any[]): Query<AppModelType, DbModelType>;
381406

382-
startAfter(snapshot: DocumentSnapshot<AppModelType, DbModelType>): Query<AppModelType, DbModelType>;
407+
startAfter(
408+
snapshot: DocumentSnapshot<AppModelType, DbModelType>
409+
): Query<AppModelType, DbModelType>;
383410
startAfter(...fieldValues: any[]): Query<AppModelType, DbModelType>;
384411

385-
endBefore(snapshot: DocumentSnapshot<AppModelType, DbModelType>): Query<AppModelType, DbModelType>;
412+
endBefore(
413+
snapshot: DocumentSnapshot<AppModelType, DbModelType>
414+
): Query<AppModelType, DbModelType>;
386415
endBefore(...fieldValues: any[]): Query<AppModelType, DbModelType>;
387416

388-
endAt(snapshot: DocumentSnapshot<AppModelType, DbModelType>): Query<AppModelType, DbModelType>;
417+
endAt(
418+
snapshot: DocumentSnapshot<AppModelType, DbModelType>
419+
): Query<AppModelType, DbModelType>;
389420
endAt(...fieldValues: any[]): Query<AppModelType, DbModelType>;
390421

391422
isEqual(other: Query<AppModelType, DbModelType>): boolean;
@@ -430,10 +461,14 @@ export class QuerySnapshot<AppModelType, DbModelType> {
430461
readonly size: number;
431462
readonly empty: boolean;
432463

433-
docChanges(options?: SnapshotListenOptions): Array<DocumentChange<AppModelType, DbModelType>>;
464+
docChanges(
465+
options?: SnapshotListenOptions
466+
): Array<DocumentChange<AppModelType, DbModelType>>;
434467

435468
forEach(
436-
callback: (result: QueryDocumentSnapshot<AppModelType, DbModelType>) => void,
469+
callback: (
470+
result: QueryDocumentSnapshot<AppModelType, DbModelType>
471+
) => void,
437472
thisArg?: any
438473
): void;
439474

@@ -452,7 +487,7 @@ export interface DocumentChange<AppModelType, DbModelType> {
452487
export class CollectionReference<
453488
AppModelType = DocumentData,
454489
DbModelType extends DocumentData = DocumentData
455-
> extends Query<AppModelType, DbModelType> {
490+
> extends Query<AppModelType, DbModelType> {
456491
private constructor();
457492

458493
readonly id: string;
@@ -461,7 +496,9 @@ export class CollectionReference<
461496

462497
doc(documentPath?: string): DocumentReference<AppModelType, DbModelType>;
463498

464-
add(data: AppModelType): Promise<DocumentReference<AppModelType, DbModelType>>;
499+
add(
500+
data: AppModelType
501+
): Promise<DocumentReference<AppModelType, DbModelType>>;
465502

466503
isEqual(other: CollectionReference<AppModelType, DbModelType>): boolean;
467504

0 commit comments

Comments
 (0)