@getcronit/pylon
Version:

15 lines (14 loc) • 823 B
TypeScript
import type { ErrorInfo } from './types';
type ErrorStoreData = {
error: Error | null;
errorInfo: ErrorInfo | null;
errorType: 'caught' | 'uncaught' | 'recoverable' | 'identifier' | null;
};
export declare function reportError(error: Error, errorInfo: ErrorInfo, errorType: 'caught' | 'uncaught' | 'recoverable' | 'identifier'): void;
export declare function clearError(): void;
export declare function subscribeToErrors(callback: (data: ErrorStoreData) => void): () => void;
export declare function getCurrentError(): ErrorStoreData;
export declare const onCaughtErrorProd: (error: Error, errorInfo: ErrorInfo) => void;
export declare const onUncaughtErrorProd: (error: Error, errorInfo: ErrorInfo) => void;
export declare const onRecoverableErrorProd: (error: Error, errorInfo: ErrorInfo) => void;
export {};