Skip to content

Commit 230c48b

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 3537d0b commit 230c48b

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
@@ -380,8 +380,8 @@ declare namespace admin.database {
380380
update(values: Object, onComplete?: (a: Error|null) => any): Promise<void>;
381381
}
382382

383-
interface ThenableReference extends admin.database.Reference, PromiseLike<any> {}
384-
383+
interface ThenableReference extends admin.database.Reference, Promise<admin.database.Reference> {}
384+
385385
function enableLogging(logger?: boolean|((message: string) => any), persistent?: boolean): any;
386386
}
387387

0 commit comments

Comments
 (0)