export interface ApiError { success: false; error: number; errhighlight: number; message: string; } export function isApiError(response: unknown): response is ApiError { return ( typeof response === 'object' && response !== null && 'success' in response && (response as ApiError).success === false ); }