UNPKG

@gulibs/vgrove-ui

Version:

VGrove UI component library built with HeroUI and React

48 lines 1.26 kB
/** * VGrove 守卫失败提示组件系统 * 支持多种显示方式和动画效果的提示组件 */ import React from 'react'; import type { GuardFailureConfig } from '../client/middleware'; /** * 提示项 */ interface NotificationItem { id: string; config: GuardFailureConfig; timestamp: number; } /** * 上下文类型 */ interface GuardFailureContextType { /** 显示提示 */ showNotification: (config: GuardFailureConfig) => string; /** 关闭提示 */ closeNotification: (id: string) => void; /** 清空所有提示 */ clearAll: () => void; /** 当前提示列表 */ notifications: NotificationItem[]; } /** * 守卫失败提示提供者组件 */ export declare const GuardFailureProvider: React.FC<{ children: React.ReactNode; maxNotifications?: number; }>; /** * 使用守卫失败提示的 Hook */ export declare const useGuardFailure: () => GuardFailureContextType; /** * 处理 HTTP 响应中的守卫失败信息 */ export declare const handleGuardFailureResponse: (response: Response) => GuardFailureConfig | null; /** * 监听守卫失败事件的 Hook */ export declare const useGuardFailureListener: () => void; export {}; //# sourceMappingURL=GuardFailureProvider.d.ts.map