@quanxi/ui
Version:
全悉组件库
37 lines (36 loc) • 1.04 kB
TypeScript
import React from "react";
import "./style.scss";
type TypeProps = "info" | "success" | "warning" | "error";
interface Config {
message: string | React.ReactNode;
description: string | React.ReactNode;
onClick?: () => void;
onClose?: () => void;
className?: string;
duration?: number | null;
style?: Record<string, unknown>;
placement?: "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
bottom?: number;
top?: number;
closeIcon?: React.ReactNode;
btn?: React.ReactNode;
icon?: React.ReactNode;
type?: TypeProps;
isGlobal?: boolean;
}
export type NotificationItemProps = Config;
type Func = (config: NotificationItemProps) => void;
interface ApiProps {
open: Func;
success: Func;
info: Func;
warning: Func;
error: Func;
}
type ContextHolderProps = string;
interface NotificationProps extends ApiProps {
config: Func;
useNotification: () => [ApiProps, ContextHolderProps];
}
declare const Notification: NotificationProps;
export default Notification;