import { ViewModel } from "./ViewModel"; import type { Options as BaseOptions } from "./ViewModel"; import type { Session } from "../matrix/Session"; import { ErrorViewModel } from "./ErrorViewModel"; import type { LogCallback, LabelOrValues } from "../logging/types"; export type Options = BaseOptions & { session: Session; }; /** Base class for view models that need to report errors to the UI. */ export declare class ErrorReportViewModel = Options> extends ViewModel { private _errorViewModel?; get errorViewModel(): ErrorViewModel | undefined; /** Typically you'd want to use `logAndCatch` when implementing a view model method. * Use `reportError` when showing errors on your model that were set by * background processes using `ErrorBoundary` or you have some other * special low-level need to write your try/catch yourself. */ protected reportError(error: Error): void; /** Combines logging and error reporting in one method. * Wrap the implementation of public view model methods * with this to ensure errors are logged and reported.*/ protected logAndCatch(labelOrValues: LabelOrValues, callback: LogCallback, errorValue?: T): T; }