import type { AnyAction } from 'redux'; import type { ServerError } from '@mattermost/types/errors'; import type { GlobalState } from '@mattermost/types/store'; import type { DispatchFunc, GetStateFunc, ActionFuncAsync } from 'mattermost-redux/types/actions'; type ActionType = string; export declare function forceLogoutIfNecessary(err: ServerError, dispatch: DispatchFunc, getState: GetStateFunc): void; export declare function requestData(type: ActionType): { type: string; data: null; }; export declare function requestSuccess(type: ActionType, data: any): { type: string; data: any; }; export declare function requestFailure(type: ActionType, error: ServerError): any; /** * Returns an ActionFunc which calls a specfied (client) function and * dispatches the specifed actions on request, success or failure. * * @export * @param {Object} obj an object for destructirung required properties * @param {() => Promise} obj.clientFunc clientFunc to execute * @param {ActionType} obj.onRequest ActionType to dispatch on request * @param {(ActionType | Array)} obj.onSuccess ActionType to dispatch on success * @param {ActionType} obj.onFailure ActionType to dispatch on failure * @param {...Array} obj.params * @returns {ActionFunc} ActionFunc */ export declare function bindClientFunc Promise>({ clientFunc, onRequest, onSuccess, onFailure, params, }: { clientFunc: Func; onRequest?: ActionType; onSuccess?: ActionType | ActionType[]; onFailure?: ActionType; params?: Parameters; }): ActionFuncAsync>, GlobalState, AnyAction>; export declare function debounce(func: (...args: any) => unknown, wait: number, immediate?: boolean, cb?: () => unknown): (...args: any[]) => void; export declare class FormattedError extends Error { intl: { id: string; defaultMessage: string; values: any; }; constructor(id: string, defaultMessage: string, values?: any); } export {};