export type AppValue = any

export type EventMap = {[key: string]: unknown}
export type EventListenerReturn = unknown

export type BaseEventMap = EventMap & {
    'message.alert': MessageAlertEvent,
    'message.modal': MessageModalEvent,
}

export type AppDataMap = {[key: string]: unknown}

export type BaseAppDataMap = AppDataMap & {
    appUrl: string
}

export type MessageAlertEvent = {
    severity: 'error' | 'warning' | 'info' | 'success'
    message: string
    timeoutSec?: number
    onDismiss?: () => unknown
}

export type MessageModalEvent = {
    title: string
    message: string
    // fixme: buttons, inputs
}
