import type { Dictionary, Fn } from '../@aileron/declare/index.js'; import type { ModalNode } from '../core/index.js'; import type { AlertModal } from './alert.js'; import type { ModalBackground } from './background.js'; import type { ConfirmModal } from './confirm.js'; import type { PromptModal } from './prompt.js'; export type Modal = AlertModal | ConfirmModal | PromptModal; export type ManagedEntity = { id: number; initiator: string; }; export type ManagedModal = ManagedEntity & Modal; export type ModalFrameProps = { id: number; type: 'alert' | 'confirm' | 'prompt'; alive: boolean; visible: boolean; initiator: string; manualDestroy: boolean; closeOnBackdropClick: boolean; background?: ModalBackground; onConfirm: Fn; onClose: Fn; onChange: Fn<[value: any]>; onDestroy: Fn; onChangeOrder: Fn; context: Context; }; interface ModalIdProps { modalId: ModalNode['id']; } export interface PresenterProps extends ModalIdProps { getValue: Fn<[], number>; increment: Fn<[], number>; reset: Fn<[], number>; } export interface ModalLayerProps extends ModalIdProps { onChangeOrder: Fn; } export interface ModalHandlersWithId { onConfirm: Fn<[modalId: ModalNode['id']]>; onClose: Fn<[modalId: ModalNode['id']]>; onChange: Fn<[modalId: ModalNode['id'], value: any]>; onDestroy: Fn<[modalId: ModalNode['id']]>; } export type ModalActions = { modal: ModalNode | undefined; onConfirm: Fn; onClose: Fn; onChange: Fn<[value: any]>; onDestroy: Fn; }; export {};