/** * Common Type Utilities * * Reusable types to replace `any` throughout the codebase */ /** * Generic error type for catch blocks */ export type ErrorLike = Error | { message?: string; [key: string]: unknown; }; /** * JSON-serializable value */ export type JsonValue = string | number | boolean | null | JsonObject | JsonArray; export type JsonObject = { [key: string]: JsonValue; }; export type JsonArray = JsonValue[]; /** * Unknown record (safer than any for object types) */ export type UnknownRecord = Record; /** * HTTP request/response types */ export interface HttpError extends Error { status?: number; statusCode?: number; response?: Response; code?: string; } /** * Generic API response wrapper */ export interface ApiResponse { ok: boolean; data?: T; error?: string; message?: string; } /** * Event handler function type */ export type EventHandler = (event: T) => Promise | void; /** * Async function that may throw */ export type AsyncFunction = (arg: T) => Promise; /** * Get error message from unknown error type */ export declare function getErrorMessage(error: unknown): string; /** * Check if value is an Error-like object */ export declare function isErrorLike(value: unknown): value is Error; //# sourceMappingURL=common.d.ts.map