@cfxjs/react-ui
Version:
Modern and minimalist React UI library.
20 lines (19 loc) • 1.08 kB
TypeScript
import React from 'react';
import { ToastWithID } from '../use-toasts/toast-container';
import { MessageItemProps } from '../use-messages/message-item';
import { NotificationItemProps } from '../use-notifications/notification-item';
export declare type UpdateToastsFunction<T> = (fn: (toasts: Array<T>) => Array<T>) => any;
export declare type UpdateMessagesFunction<T> = (fn: (messages: Array<T>) => Array<T>) => any;
export declare type UpdateNotificationsFunction<T> = (fn: (notifications: Array<T>) => Array<T>) => any;
export interface CfxUIContextParams {
messages: Array<MessageItemProps>;
updateMessages: UpdateMessagesFunction<MessageItemProps>;
notifications: Array<NotificationItemProps>;
updateNotifications: UpdateNotificationsFunction<NotificationItemProps>;
toasts: Array<ToastWithID>;
toastHovering: boolean;
updateToasts: UpdateToastsFunction<ToastWithID>;
updateToastHoverStatus: Function;
}
export declare const CfxUIContent: React.Context<CfxUIContextParams>;
export declare const useCfxUIContext: () => CfxUIContextParams;