Skip to content

Commit be0765b

Browse files
jsayolhiranya911
authored andcommitted
ThenableReference should extend Promise, not PromiseLike (#498)
ThenableReference implements a `.catch()` method, but `ref.push(...).catch(...)` generates a TypeScript error, since neither the `Reference` nor `PromiseLike` interfaces have that method. This change was [already done on the JS SDK](firebase/firebase-js-sdk#1462) back in January, and this PR simply puts the admin SDK back in line with it.
1 parent e7ee8a1 commit be0765b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ declare namespace admin.database {
443443
update(values: Object, onComplete?: (a: Error|null) => any): Promise<void>;
444444
}
445445

446-
interface ThenableReference extends admin.database.Reference, PromiseLike<any> {}
446+
interface ThenableReference extends admin.database.Reference, Promise<admin.database.Reference> {}
447447

448448
function enableLogging(logger?: boolean|((message: string) => any), persistent?: boolean): any;
449449
}

0 commit comments

Comments
 (0)