geonet
Version:
A Node.js API wrapper for GeoNet — Aotearoa's geological hazard monitoring system.
45 lines (44 loc) • 1.89 kB
TypeScript
import { MMI } from "../../@types/common";
import { QuakeHistoryResponse, QuakeResponse, QuakesResponse, QuakeStatsResponse } from "../../@types/quake";
import { BaseService } from "./BaseService";
/**
* QuakeService class for fetching quake information from the GeoNet API.
* @extends BaseService
* @since 1.0.0
*/
export declare class QuakeService extends BaseService {
/**
* Fetches quake data for a given public ID.
*
* @param {string} publicID - The public ID of the earthquake.
* @returns {Promise<QuakeResponse>} - A promise that resolves to the quake data.
* @throws {Error} - Throws an error if the public ID is not provided.
* @since 1.0.0
*/
getQuake(publicID: string): Promise<QuakeResponse>;
/**
* Fetches location history data for a given public ID. Not all quakes have a location history.
*
* @param {string} publicID - The public ID for the earthquake.
* @returns {Promise<QuakeHistoryResponse>} - A promise that resolves to the quake history data. The features array may be empty!
* @throws {Error} - Throws an error if the public ID is not provided.
* @since 1.0.0
*/
getQuakeHistory(publicID: string): Promise<QuakeHistoryResponse>;
/**
* Fetches quake stats for the past 365 days.
*
* @returns {Promise<QuakeStatsResponse>} - A promise that resolves to the quake stats data.
* @since 1.0.0
*/
getQuakeStats(): Promise<QuakeStatsResponse>;
/**
* Fetches all quakes that have occurred over the past 365 days.
*
* @param {MMI} mmi - The request object containing the MMI.
* @returns {Promise<QuakesResponse>} - A promise that resolves to the quakes data.
* @throws {Error} - Throws an error if the MMI is not provided or is not a valid MMI.
* @since 1.0.0
*/
getQuakes(mmi: MMI): Promise<QuakesResponse>;
}