import React, { ReactNode } from 'react'; export interface NoticeBarProps { /** * 自定义类名 * @en Custom classname */ className?: string; /** * 自定义样式,背景颜色和文字颜色可直接在这里指定`background`和`color` * @en Custom stylesheet, background color and text color can be directly specified here `background` and `color` */ style?: React.CSSProperties; /** * 通知内容文字,如需垂直滚动效果可传入一个Carousel * @en Notification content text, if need vertical scrolling effect, you can input a Carousel */ children?: ReactNode; /** * 左侧内容 * @en Content on the left */ leftContent?: ReactNode; /** * 右侧内容 * @en Content on the right */ rightContent?: ReactNode; /** * 通知文字处理方式,为`overflow`则文字超出容器长度时才滚动,为`none`则文字始终不滚动,为`always`则文字始终滚动 * @en The text processing method of the notification. When it is `overflow`, the text will only scroll when the length of the container exceeds the length of the container. If it is `none`, the text will never scroll, and if it is `always`, the text will always scroll. * @default "overflow" */ marquee?: 'overflow' | 'none' | 'always'; /** * 是否可关闭 * @en Closeable * @default true */ closeable?: boolean; /** * 自定义关闭图标 * @en Custom close icon * @default \ */ closeIcon?: ReactNode; /** * 是否需要换行,当 marquee=none 且 wrapable=false 时,文字超出会有溢出省略(ellipsis)效果 * @en Whether line wrapping is required, when marquee=none and wrapable=false, there will be overflow ellipsis effect when the text exceeds * @default true */ wrapable?: boolean; /** * 文字滚动速度,单位是px/s * @en Text scrolling speed in px/s * @default 50 */ speed?: number; /** * 文字开始滚动之前的延迟(ms) * @en Delay before text starts scrolling (ms) * @default 1000 */ delay?: number; /** * 是否根据`style`属性中自定义的背景色自动设置渐变背景色 * @en Whether to automatically set the gradient background color based on the custom background color in the `style` attribute * @default true */ autoSetGradientStyle?: boolean; /** * 点击通知栏事件 * @en Click on notification bar event */ onClick?: (e: React.MouseEvent) => void; /** * 点击关闭按钮回调 * @en Callback when clicking close button */ onClose?: (e: React.MouseEvent) => void; } export interface NoticeBarRef { /** * 最外层元素 DOM * @en The outermost element DOM */ dom: HTMLDivElement | null; /** * 手动关闭通知栏,即移除当前组件 * @en Manually close the notification bar, that is, remove the current component */ close: () => void; /** * 手动更新组件布局 * @en Manually update the component layout */ updateData: () => void; } /** * 可自定义换行或滚动效果,支持循环滚动。 * @en Line wrapping or scrolling effects can be customized, and circular scrolling is supported. * @type 信息展示 * @type_en Data Display * @name 通知栏 * @name_en NoticeBar */ declare const NoticeBar: React.ForwardRefExoticComponent>; export default NoticeBar;