/** * This file defines shared types and utility functions for the error handling system. * It is designed to be used with the React Context-based error provider. */ /** * Custom error type used to mark errors that have already been * handled (i.e., a notification has been triggered for them). * * Global listeners can detect this error type and avoid showing a * duplicate notification for the same issue. */ export declare class HandledError extends Error { constructor(message: string); } /** * Utility for throwing an error from non-component code while still triggering a UI notification. * * This function performs two actions: * 1. Dispatches a global `add-app-error` custom event with the error details. * The `ErrorProvider` listens for this event and adds the error to its state. * 2. Throws a `HandledError` to interrupt execution flow, which can be caught * by React/Next.js error boundaries. * * @param message The error message. * @param title An optional title for the error notification. */ export declare const throwError: (message: string, title?: string) => never;