osm-api
Version:
πΊοΈπ Javascript/Typescript wrapper around the OpenStreetMap API
43 lines (42 loc) β’ 2.36 kB
TypeScript
import type { OsmFeature, OsmFeatureType, OsmRelation, OsmWay, UtilFeatureForType } from "../types";
import { type FetchOptions } from "./_osmFetch";
/**
* Gets infomation about a node, way, or relation.
*
* @param full if true, the members of the relation and the nodes of any ways
* will be returned. This option has no effect for nodes
*
* @returns an array, which will only have one item unless you specify `full=true`
*/
export declare function getFeature<T extends OsmFeatureType>(type: T, id: number, full?: false, options?: FetchOptions): Promise<[UtilFeatureForType<T>]>;
/**
* Gets infomation about a node, way, or relation.
*
* @param full if true, the members of the relation and the nodes of any ways
* will be returned. This option has no effect for nodes
*
* @returns an array, which will only have one item unless you specify `full=true`
*/
export declare function getFeature(type: OsmFeatureType, id: number, full: true, options?: FetchOptions): Promise<OsmFeature[]>;
/**
* Gets infomation about **multiple** nodes, ways, or relations.
* The IDs can be numbers, or a number plus a version (e.g. `123456789v2`)
*/
export declare function getFeatures<T extends OsmFeatureType>(type: T, ids: (number | string)[], options?: FetchOptions): Promise<UtilFeatureForType<T>[]>;
/**
* Similar to `getFeature()`, except that this fetched **the specified version**
* of the node, way, or relation.
*
* Unlike `getFeature()`, the `full` option is not supported.
*/
export declare function getFeatureAtVersion<T extends OsmFeatureType>(type: T, id: number, version: number, options?: FetchOptions): Promise<UtilFeatureForType<T>>;
/**
* Similar as `getFeature()`, except that this fetches **all versions**
* of the node, way, or relation.
* Unlike `getFeature()`, the `full` option is not supported.
*/
export declare function getFeatureHistory<T extends OsmFeatureType>(type: T, id: number, options?: FetchOptions): Promise<UtilFeatureForType<T>[]>;
/** gets a list of ways that a node belongs to */
export declare function getWaysForNode(nodeId: number, options?: FetchOptions): Promise<OsmWay[]>;
/** gets a list of relations that a node, way, or relation belongs to */
export declare function getRelationsForElement(type: OsmFeatureType, id: number, options?: FetchOptions): Promise<OsmRelation[]>;