geofire
Version:
Location-based querying and filtering using Firebase
26 lines (25 loc) • 1.02 kB
TypeScript
import { Document } from './GeoFireTypes';
import { Geopoint, Geohash } from "geofire-common";
import { DataSnapshot } from 'firebase/database';
/**
* Encodes a location and geohash as a GeoFire object.
*
* @param location The location as [latitude, longitude] pair.
* @param geohash The geohash of the location.
* @returns The location encoded as GeoFire object.
*/
export declare function encodeGeoFireObject(location: Geopoint, geohash: Geohash): Document;
/**
* Decodes the location given as GeoFire object. Returns null if decoding fails.
*
* @param geoFireObj The location encoded as GeoFire object.
* @returns The location as [latitude, longitude] pair or null if decoding fails.
*/
export declare function decodeGeoFireObject(geoFireObj: Document): Geopoint;
/**
* Returns the key of a Firebase snapshot across SDK versions.
*
* @param A Firebase snapshot.
* @returns The Firebase snapshot's key.
*/
export declare function geoFireGetKey(snapshot: DataSnapshot): string;