import type { MessageInstance } from 'antd/es/message/interface'; let messageApi: MessageInstance | null = null; export function setMessageApi(api: MessageInstance) { messageApi = api; } export function getMessageApi(): MessageInstance { if (!messageApi) { throw new Error('Message API not initialized. Ensure is mounted.'); } return messageApi; }