import type { UserInfo } from '@sinoform/types'; import React from 'react'; /** * 应用上下文信息数据结构接口 */ export interface AppContextInterface { /** * 当前登录用户信息 */ currentUser: UserInfo; /** * 进入详情页 * * @param recordId 表单数据id * @param workItemId 待办、已办数据id * @param showBack 显示详情页的时候控制无流程列表返回按钮不消失 */ gotoDetailPage(recordId: string, workItemId?: string, showBack?: boolean, noFlowForm?: boolean, pageType?: 'noRead' | 'read', toReadId?: string): void; /** * 进入草稿页 * * @param recordId 表单数据id */ gotoDraftPage(recordId: string): void; /** * 进入创建页面 */ gotoCreatePage(): void; /** * 退出详情页 */ exitDetailPage(): void; /** * 发布全局事件 * * @param eventName 事件名称 * @param eventData 事件数据 */ dispatchEvent(eventName: string, eventData?: T): void; /** * 监听事件 * * @param eventName 事件名称 * @param callback 回调函数 */ useListenEvent(eventName: string, callback: (event: Event) => void): void; } /** * 应用上下文 */ declare const AppContext: React.Context; export default AppContext;