export declare class CustomError extends Error { constructor(); } declare type Context = Exclude; export declare class DomainError extends CustomError { readonly context: T; readonly error: Error | undefined; readonly code: number; readonly meta: M | undefined; constructor(context: Context); constructor(context: Context, error: Error); constructor(context: Context, errorCode: number, meta?: M); constructor(context: Context, error: Error, errorCode: number, meta?: M); } export declare function handleGlobalError(fn: (error: Error, event: ErrorEvent | PromiseRejectionEvent) => void): () => void; export {};