/** * Error utilities for better developer experience * Provides contextual error messages with suggestions */ export interface ErrorContext { file?: string; line?: number; code?: string; cause?: string; suggestions?: string[]; } /** * Format a contextual error message with suggestions */ export declare function formatError(title: string, context: ErrorContext, originalError?: Error): string; /** * Common error scenarios with predefined messages */ export declare const ErrorScenarios: { QUERIES_NOT_FOUND: (filePath: string) => ErrorContext; QUERIES_INVALID_EXPORT: (filePath: string) => ErrorContext; QUERIES_MISSING_REQUIRED_FIELD: (queryName: string, field: string, filePath: string) => ErrorContext; QUERIES_INVALID_METHOD: (queryName: string, method: string, filePath: string) => ErrorContext; SCHEMAS_NOT_FOUND: (filePath: string) => ErrorContext; SCHEMAS_INVALID_EXPORT: (filePath: string) => ErrorContext; SCHEMAS_INVALID_BASE_MODEL: (schemaName: string, baseModel: string, filePath: string) => ErrorContext; SCHEMAS_INVALID_FIELD: (schemaName: string, fieldName: string, baseModel: string, filePath: string) => ErrorContext; SCHEMAS_INVALID_RELATION: (schemaName: string, relationName: string, baseModel: string, filePath: string) => ErrorContext; SCHEMAS_MISSING_SHAPE: (schemaName: string, relationName: string, filePath: string) => ErrorContext; MODULE_LOADING_ERROR: (filePath: string, error: string) => ErrorContext; TYPESCRIPT_ERROR: (filePath: string, error: string) => ErrorContext; PRISMA_ERROR: (error: string) => ErrorContext; GENERATION_ERROR: (component: string, error: string) => ErrorContext; QUERIES_INVALID_PATH_FORMAT: (queryName: string, path: string, filePath: string) => ErrorContext; QUERIES_UNDECLARED_PATH_PARAM: (queryName: string, paramName: string, filePath: string) => ErrorContext; QUERIES_INVALID_PARAM_TYPE: (paramName: string, paramType: string, filePath: string) => ErrorContext; QUERIES_INVALID_PARAM_ENUM: (paramName: string, filePath: string) => ErrorContext; QUERIES_INVALID_PARAM_RANGE: (paramName: string, filePath: string) => ErrorContext; SCHEMAS_MISSING_BASE_MODEL: (schemaName: string, filePath: string) => ErrorContext; SCHEMAS_MISSING_FIELDS: (schemaName: string, filePath: string) => ErrorContext; SCHEMAS_INVALID_FIELD_SHAPE: (schemaName: string, fieldName: string, filePath: string) => ErrorContext; }; /** * Throw a formatted error with context */ export declare function throwError(title: string, context: ErrorContext, originalError?: Error): never; /** * Log a warning with context */ export declare function logWarning(title: string, context: ErrorContext): void; //# sourceMappingURL=errors.d.ts.map