I was using firebase 7.16.1 and I was importing and declaring a property as Timestamp this way:
import { firestore } from 'firebase/app';
export class CourseEventMessage {
sentTimestamp: firestore.Timestamp;
}
But after upgrading to firebase 8.1.2, the import is getting an error:
Module '"../../../node_modules/firebase"' has no exported member 'firestore'. Did you mean to use 'import firestore from "../../../node_modules/firebase"' instead?ts(2614)
I've tried the following imports, all of them imports ok, but no Timestamp exists on the import.
import firestore from "../../../node_modules/firebase";
import firestore from 'firebase';
import firestore from 'firebase/app';
The only way I could found that imports Timestamp was:
import * as firebase from 'firebase/app';
export class CourseEventMessage {
sentTimestamp: firebase.default.firestore.Timestamp;
}
So what's the proper way to import the Timestamp class?