@vepler/area-reference-types
Version:
TypeScript type definitions for Vepler Area Reference API
75 lines (74 loc) • 1.37 kB
TypeScript
/**
* Common types shared across Areas API endpoints
*/
import { Dictionary, GeoJSONGeometry, HierarchyNode } from '../../common';
/**
* Base geographic entity in API responses
*/
export interface GeographicEntityResponse {
/**
* Unique database identifier
*/
id?: number;
/**
* Geographic entity code
*/
code: string;
/**
* Human-readable name
*/
name: string;
/**
* Entity type from geographic layer types
*/
type: string;
/**
* Entity status (active, inactive, etc.)
*/
status?: string;
/**
* Additional metadata
*/
metadata?: Dictionary;
/**
* Latitude coordinate
*/
lat?: number;
/**
* Longitude coordinate
*/
long?: number;
/**
* Full GeoJSON geometry
*/
geometry?: GeoJSONGeometry;
/**
* Distance from query point (for spatial queries)
*/
distance?: number;
/**
* Administrative hierarchy
*/
hierarchy?: HierarchyNode[];
/**
* Area size in square metres
*/
areaSqm?: number;
}
/**
* Common error response for areas endpoints
*/
export interface AreasErrorResponse {
/**
* Success flag
*/
success: false;
/**
* Error message
*/
error: string;
/**
* HTTP status code
*/
statusCode: number;
}