Skip to content

Commit 18608c7

Browse files
committed
ThenableReference should extend Promise, not PromiseLike
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 31af105 commit 18608c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ 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> {}
447-
446+
interface ThenableReference extends admin.database.Reference, Promise<admin.database.Reference> {}
447+
448448
function enableLogging(logger?: boolean|((message: string) => any), persistent?: boolean): any;
449449
}
450450

0 commit comments

Comments
 (0)