UNPKG

mattermost-redux

Version:

Common code (API client, Redux stores, logic, utility functions) for building a Mattermost client

45 lines (44 loc) 1.48 kB
import type { ErrorObject } from 'serialize-error'; import type { ServerError } from '@mattermost/types/errors'; import type { GlobalState } from '@mattermost/types/store'; import type { ActionFuncAsync } from 'mattermost-redux/types/actions'; export declare function dismissError(index: number): { type: "DISMISS_ERROR"; index: number; data: null; }; export declare function getLogErrorAction(error: ErrorObject, displayable?: boolean): { type: "LOG_ERROR"; displayable: boolean; error: ErrorObject; data: null; }; export type LogErrorOptions = { /** * errorBarMode controls how and when the error bar is shown for this error. * * If unspecified, this defaults to DontShow. */ errorBarMode?: LogErrorBarMode; }; export declare enum LogErrorBarMode { /** * Always show the error bar for this error. */ Always = "Always", /** * Never show the error bar for this error. */ Never = "Never", /** * Only shows the error bar if Developer Mode is enabled, and the message displayed will tell the user to check the * JS console for more information. */ InDevMode = "InDevMode" } export declare function logError(error: ServerError, options?: LogErrorOptions): ActionFuncAsync<boolean>; export declare function shouldShowErrorBar(state: GlobalState, options: LogErrorOptions): boolean; export declare function clearErrors(): { type: "CLEAR_ERRORS"; data: null; };