geofirestore-core
Version:
Lightweight location-based querying and encoding of Firebase Firestore Documents for geofirestore.
32 lines (31 loc) • 1.57 kB
TypeScript
import { GeoQuerySnapshot } from './snapshot';
import { GeoFirestoreTypes } from '../definitions';
/**
* Executes a query and returns the result(s) as a GeoQuerySnapshot.
*
* WEB CLIENT ONLY
* Note: By default, get() attempts to provide up-to-date data when possible by waiting for data from the server, but it may return
* cached data or fail if you are offline and the server cannot be reached. This behavior can be altered via the `GetOptions` parameter.
*
* @param query The Firestore Query instance.
* @param queryCriteria The query criteria of geo based queries, includes field such as center, radius, and limit.
*/
export declare function geoQueryGet(query: GeoFirestoreTypes.cloud.Query | GeoFirestoreTypes.web.Query, queryCriteria: GeoFirestoreTypes.QueryCriteria, options?: GeoFirestoreTypes.web.GetOptions): Promise<GeoQuerySnapshot>;
/**
* A `GeoJoinerGet` aggregates multiple `get` results.
*/
export declare class GeoQueryGet {
private _queryCriteria;
private _docs;
/**
* @param snapshots An array of snpashots from a Firestore Query `get` call.
* @param _queryCriteria The query criteria of geo based queries, includes field such as center, radius, and limit.
*/
constructor(snapshots: GeoFirestoreTypes.web.QuerySnapshot[], _queryCriteria: GeoFirestoreTypes.QueryCriteria);
/**
* Returns parsed docs as a GeoQuerySnapshot.
*
* @return A new `GeoQuerySnapshot` of the filtered documents from the `get`.
*/
getGeoQuerySnapshot(): GeoQuerySnapshot;
}