@vepler/area-reference-types
Version:
TypeScript type definitions for Vepler Area Reference API
54 lines (53 loc) • 1.16 kB
TypeScript
/**
* Common types shared across Geographic API endpoints
*/
import { GeographicEntityType } from '../../common';
/**
* Geographic resolution strategy
*/
export type ResolutionStrategy = 'direct' | 'up' | 'down' | 'lateral' | 'none';
/**
* Geographic utility error response
*/
export interface GeographicErrorResponse {
/**
* Success flag
*/
success: false;
/**
* Error message
*/
error: string;
/**
* HTTP status code
*/
statusCode: number;
/**
* Additional error details
*/
details?: {
/**
* Invalid geography types
*/
invalidTypes?: GeographicEntityType[];
/**
* Invalid geography codes
*/
invalidCodes?: string[];
/**
* Unsupported resolution paths
*/
unsupportedResolutions?: Array<{
from: GeographicEntityType;
to: GeographicEntityType;
reason: string;
}>;
/**
* Parameter validation errors
*/
validationErrors?: Array<{
field: string;
message: string;
}>;
};
}