I'm facing a very similar problem as this Github issue and I can't understand how can I fix it and why the types are being exported as const from firebase sdk.
The code that reexports firebase types is the following:
import * as firebase from '@firebase/rules-unit-testing'
export type Firestore = firebase.firestore.Firestore;
export type FirestoreDocReference = firebase.firestore.Firestore;
I just want to re-export firestore types so I can declare my functions signature with typed return:
function getFirestore(auth?: any): Firestore
Reading the SDK source code I notice that firestore is being exported as follows:
declare const firestore: typeof firebase.firestore, database: typeof firebase.database;
export { firestore, database };
It is exported as a const, not a type. How can I workaround this? And why they are using const instead of type here?