@vepler/locations-types
Version:
TypeScript type definitions for Vepler Locations Service
81 lines (80 loc) • 1.49 kB
TypeScript
/**
* Common API response types shared across all endpoints
*/
/**
* Base success response structure
*/
export interface SuccessResponse<T> {
/**
* Success flag
*/
success: true;
/**
* Response data
*/
result: T;
/**
* Optional metadata
*/
meta?: {
/**
* Total count of matching records
*/
total?: number;
/**
* Pagination offset
*/
offset?: number;
/**
* Results limit
*/
limit?: number;
/**
* Query used for search
*/
query?: string;
/**
* Additional processing information
*/
processing?: {
/**
* Response time in milliseconds
*/
responseTime?: number;
/**
* Number of records processed
*/
recordsProcessed?: number;
};
};
}
/**
* Error response structure
*/
export interface ErrorResponse {
/**
* Success flag
*/
success: false;
/**
* Error message
*/
error: string;
/**
* HTTP status code
*/
statusCode: number;
/**
* Optional error details
*/
details?: {
/**
* Error code for programmatic handling
*/
code?: string;
/**
* Additional context about the error
*/
context?: Record<string, any>;
};
}