@vepler/area-reference-types
Version:
TypeScript type definitions for Vepler Area Reference API
102 lines (101 loc) • 1.91 kB
TypeScript
/**
* Get POI Bounds API Types
*
* /poi/bounds endpoint
*/
import { POIFeature } from './common';
/**
* Bounding box coordinates
*/
export type BoundingBox = [number, number, number, number];
/**
* Get POI bounds path parameters
*/
export interface GetPOIBoundsPathParams {
/**
* Zoom level (0-22)
*/
z: number;
/**
* X coordinate of the tile
*/
x: number;
/**
* Y coordinate of the tile
*/
y: number;
}
/**
* Get POI bounds query parameters
*/
export interface GetPOIBoundsQueryParams {
/**
* Response format
*/
format?: 'geojson' | 'mvt';
/**
* Comma-separated list of category IDs
*/
categories?: string;
}
/**
* GeoJSON response metadata
*/
export interface GeoJSONResponseMetadata {
/**
* Bounding box queried
*/
bbox: BoundingBox;
/**
* Total features in response
*/
featureCount: number;
/**
* Applied category filters
*/
categoryFilters?: string[];
/**
* Query execution time in milliseconds
*/
executionTimeMs?: number;
}
/**
* GeoJSON response for POI bounds
*/
export interface POIBoundsGeoJSONResponse {
type: 'FeatureCollection';
features: POIFeature[];
meta?: GeoJSONResponseMetadata;
}
/**
* MVT response metadata
*/
export interface MVTResponseMetadata {
/**
* Tile size in pixels
*/
tileSize: number;
/**
* Zoom level
*/
zoom: number;
/**
* Number of features in tile
*/
features: number;
}
/**
* MVT (Mapbox Vector Tile) response for POI bounds
* Note: MVT responses are binary data, not JSON
*/
export interface POIBoundsMVTResponse {
/**
* Binary tile data
* Content-Type: application/vnd.mapbox-vector-tile
*/
tileData: Uint8Array;
/**
* Response metadata in headers
*/
meta?: MVTResponseMetadata;
}