Skip to content

Commit afc7771

Browse files
authored
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, this PR simply puts the admin SDK in line with it.
1 parent 3537d0b commit afc7771

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
@@ -380,7 +380,7 @@ 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> {}
383+
interface ThenableReference extends admin.database.Reference, Promise<any> {}
384384

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

0 commit comments

Comments
 (0)