Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / docs-core / lib / Application / ApplicationEvent.ts
blob98cf4af2c7afb3abd685ba4478b8bc7a465864ab
1 import type { InternalEventBusInterface } from '@proton/docs-shared'
2 import type { SquashVerificationObjectionDecision } from '../Types/SquashVerificationObjection'
4 export enum ApplicationEvent {
5   SquashVerificationObjectionDecisionMade = 'SquashVerificationObjectionDecisionMade',
6   GeneralUserDisplayableErrorOccurred = 'GeneralUserDisplayableErrorOccurred',
9 export type DocsClientSquashVerificationObjectionMadePayload = {
10   decision: SquashVerificationObjectionDecision
13 export type GeneralUserDisplayableErrorOccurredPayload = {
14   translatedError: string
15   translatedErrorTitle?: string
16   /** If true, the UI will be destroyed and only this error will be shown */
17   irrecoverable?: boolean
18   onClose?: () => void
21 export function PostApplicationError(
22   eventBus: InternalEventBusInterface,
23   params: GeneralUserDisplayableErrorOccurredPayload,
24 ): void {
25   eventBus.publish({
26     type: ApplicationEvent.GeneralUserDisplayableErrorOccurred,
27     payload: params,
28   })