firebase / geofire-js

GeoFire for JavaScript - Realtime location queries with Firebase
MIT License
1.44k stars 345 forks source link

Can't instantiate GeoFire in TS #201

Closed adriansergheev closed 3 years ago

adriansergheev commented 3 years ago

This piece of code:

    var database = admin.database().ref()
        .child('geoData');
    var geoFireDB = new GeoFire.GeoFire(database)

Does not work. Error:

Argument of type 'import("").admin.database.Reference' is not assignable to parameter of type 'import("").Reference'. The types of 'push(...).endAt(...).isEqual' are incompatible between these types.

Type '(other: import("functions/node_modules/firebase-admin/lib/database").admin.database.Query | null) => boolean' is not assignable to type '(other: import("/cloudFunctions/functions/node_modules/@firebase/database-types/index").Query | null) => boolean'. Types of parameters 'other' and 'other' are incompatible. etc.

Here is what I have defined in package.json: "firebase": "^7.24.0", "firebase-admin": "^8.12.1", "firebase-functions": "^3.11.0", "geofire": "^5.0.1",

Any ideas?