Gathering detailed insights and metrics for @vepler/area-reference-types
Gathering detailed insights and metrics for @vepler/area-reference-types
Gathering detailed insights and metrics for @vepler/area-reference-types
Gathering detailed insights and metrics for @vepler/area-reference-types
npm install @vepler/area-reference-types
Typescript
Module System
78.2
Supply Chain
99.6
Quality
97.6
Maintenance
100
Vulnerability
100
License
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
This directory contains all public API types organised by route structure, making it easy to find and use the correct types for each API endpoint.
The Vepler Area Reference API is a comprehensive geographic data service that provides detailed information about UK administrative boundaries, geographic entities, connectivity metrics, and location-based services. This API enables developers to query spatial data, retrieve connectivity scores, search for locations, and access detailed geographic information across England, Scotland, Wales, and Northern Ireland.
The service supports a wide range of geographic types including counties, districts, wards, parishes, output areas, and more, making it ideal for applications requiring detailed UK geographic data integration. Whether you're building property platforms, demographic analysis tools, or location-based services, this API provides the foundational geographic data you need.
src/types/public/
├── common.ts # Global shared types (GeographicEntityType, etc.)
├── index.ts # Export all types and route namespaces
└── routes/
├── areas/ # /api/areas/* endpoints
│ ├── index.ts # Export all areas types
│ ├── common.ts # Areas-specific shared types (GeographicEntityResponse, etc.)
│ ├── within.ts # /api/areas/within
│ ├── border.ts # /api/areas/border/{targetType}/{targetCode}/{sourceType}
│ ├── children.ts # /api/areas/children/{parentCode}/{childType?}
│ ├── query.ts # /api/areas/query/{type}
│ └── get-areas.ts # /api/areas/{field}/{ids}
├── connectivity/ # /api/connectivity/* endpoints
│ ├── index.ts # Export all connectivity types
│ ├── common.ts # Connectivity-specific shared types (scores, data sources, etc.)
│ └── get-connectivity-scores.ts # /api/connectivity/scores/{geographicCodes}
├── search/ # /api/search/* endpoints
│ ├── index.ts # Export all search types
│ ├── common.ts # Search-specific shared types (SearchResult, etc.)
│ └── get-autocomplete.ts # /api/search/autocomplete
├── metrics/ # /api/metrics/* endpoints
│ ├── index.ts # Export all metrics types
│ ├── common.ts # Metrics-specific shared types (MetricValue, etc.)
│ ├── get-metric-values.ts # /api/metrics/values
│ └── ingest-metric.ts # /api/metrics/ingest
├── poi/ # /api/poi/* endpoints
│ ├── index.ts # Export all POI types
│ ├── common.ts # POI-specific shared types (POIFeature, etc.)
│ ├── get-nearest.ts # /api/poi/nearest
│ └── get-poi-bounds.ts # /api/poi/bounds
├── geographic/ # /api/geographic/* endpoints
│ ├── index.ts # Export all geographic utility types
│ ├── common.ts # Geographic-specific shared types (ResolutionStrategy, etc.)
│ ├── resolve-geography.ts # /api/geographic/resolve
│ ├── get-types.ts # /api/geographic/types
│ └── check-capability.ts # /api/geographic/capability
└── index.ts # Export all route namespaces
1import { Areas, Connectivity, Search, POI } from '../../types/public/routes'; 2 3// Areas API types 4const withinParams: Areas.WithinQueryParams = { 5 lat: 51.5074, 6 lng: -0.1278, 7 radius: 1000, 8 type: 'ward,parish' 9}; 10 11const borderResponse: Areas.BorderResponse = { 12 success: true, 13 result: { 14 target: { code: 'E05000001', name: 'City of London', type: 'ward' }, 15 sourceType: 'district', 16 areas: [], 17 count: 0 18 } 19}; 20 21// Connectivity API types 22const connectivityScore: Connectivity.ConnectivityScore = { 23 geographicCode: 'E00000001', 24 dataSources: {}, 25 metadata: { processingTimeMs: 50 } 26}; 27 28// Search API types 29const autocompleteParams: Search.GetAutocompleteQueryParams = { 30 q: 'London', 31 limit: 10 32}; 33 34// POI API types 35const nearestPOIParams: POI.GetNearestPOIQueryParams = { 36 lat: 51.5074, 37 lng: -0.1278, 38 types: 'RETAIL,FERRY,BUS', 39 radius: 1000, 40 limit: 5 41};
1// Import global common types 2import { GeographicEntityType, Dictionary, GeoJSONGeometry } from '../../types/public/common'; 3 4// Import route-specific types 5import { WithinQueryParams, BorderResponse } from '../../types/public/routes/areas'; 6import { ConnectivityScore } from '../../types/public/routes/connectivity'; 7import { GetAutocompleteQueryParams } from '../../types/public/routes/search'; 8import { GetNearestPOIQueryParams, GetNearestPOIResponse } from '../../types/public/routes/poi';
1import { 2 GeographicEntityResponse, 3 ConnectivityScore, 4 SearchResult 5} from '../../types/public/api/endpoints/areas'; // Still works
/api/areas/*
)/api/connectivity/*
)/api/search/*
)/api/metrics/*
)/api/poi/*
)/api/geographic/*
)Each folder corresponds exactly to an API route, making it intuitive to find the right types.
common.ts
): Types shared across all routes (e.g., GeographicEntityType
, Dictionary
)routes/{route}/common.ts
): Types shared within a specific routeEach endpoint has its own file with request/response types specific to that endpoint.
{EndpointName}QueryParams
{EndpointName}PathParams
{EndpointName}Response
{RouteName}ErrorResponse
All types include comprehensive JSDoc comments explaining purpose and usage.
These are the actual types used by the API handlers, not theoretical definitions.
Areas.WithinResponse
vs Search.SearchResponse
These types can be built and published as a separate npm package:
1npm run build:types 2npm publish @vepler/area-reference-types
External consumers can then use:
1import { Areas, Connectivity } from '@vepler/area-reference-types';
No vulnerabilities found.
No security vulnerabilities found.