In v5.2.0 we added Cloud Storage support to the Admin SDK. As a part of this we made a few changes to the index.d.ts file:
import {Bucket} from '@google-cloud/storage';
declare namespace admin.storage {
interface Storage {
app: admin.app.App;
bucket(name?: string): Bucket;
}
}
Turns out this is not supported properly in TypeScript. It triggers the following error in downstream apps:
node_modules/firebase-admin/lib/index.d.ts(396,3): error TS2666: Exports and export assignments are not permitted in module augmentations.
npm ERR! Test failed. See above for more details.
Simply having the import statement at the top-level of the file is sufficient to trigger the error.
Possible Solutions
- Not expose the GCS
Bucket type in our API, and use any instead.
- Change our module declaration as follows:
// index.d.ts
declare module 'firebase-admin' {
}
export = admin;
This fixes the error, but I don't know if it has other consequences.
In v5.2.0 we added Cloud Storage support to the Admin SDK. As a part of this we made a few changes to the
index.d.tsfile:Turns out this is not supported properly in TypeScript. It triggers the following error in downstream apps:
Simply having the import statement at the top-level of the file is sufficient to trigger the error.
Possible Solutions
Buckettype in our API, and useanyinstead.This fixes the error, but I don't know if it has other consequences.