import React, { CSSProperties, ReactNode } from 'react'; export interface NavBarRef { /** @deprecated */ navBar: HTMLDivElement | null; /** * 最外层元素DOM * @en The outermost element DOM */ dom: HTMLDivElement | null; } export interface NavBarProps { /** * 导航栏中间文字,带居中和溢出省略效果 * @en Navigation bar middle text, with centering and overflow omitting effects */ title?: React.ReactNode; /** * 自定义导航栏主内容,当导航栏内容为Tabs等非居中文字样式时可用 * @en Customize the main content of the navigation bar, available when the content of the navigation bar is a non-centered text style such as Tabs */ children?: React.ReactNode; /** * 导航栏左侧内容 * @en Navigation bar left content * @default 返回按钮 * @default_en Back button */ leftContent?: React.ReactNode; /** * 导航栏右侧内容 * @en Content on the right side of the navigation bar */ rightContent?: React.ReactNode; /** * 自定义样式,最外层元素的背景文字颜色可在此定义 * @en Custom stylesheet, background and text colors can be defined here */ style?: React.CSSProperties; /** * 内层自定义类名 * @en Inner custom classname */ className?: string; /** * 最外层元素自定义类名 * @en Outermost element custom classname */ wrapClass?: string; /** * 是否吸顶 * @en Whether to fix */ fixed?: boolean; /** * 沉浸式状态栏高度 * @en Immersive status bar height * @default 0 */ statusBarHeight?: number; /** * 是否有底边框 * @en Whether there is a bottom border * @default true */ hasBottomLine?: boolean; /** * 点击左侧内容回调 * @en Callback when clicking the content on the left */ onClickLeft?: (e: React.MouseEvent) => void; /** * 点击右侧内容回调 * @en Callback when clicking the content on the right */ onClickRight?: (e: React.MouseEvent) => void; /** * 展示nav-bar的offset值,当scrollTop值小于该值时,将隐藏主内容和右侧内容,左侧内容保留 * @en Display the offset value of nav-bar. When the scrollTop value is less than this value, the main content and the right content will be hidden, and the left content will remain * @default 0 */ showOffset?: number; /** * 设置showOffset后,当内容显示状态发生变化后触发 * @en After setting showOffset, triggered when the content display state changes */ onShowChange?: (show: boolean) => void; /** * 设置fixed=true时,导航栏原本的位置是否要占住 * @en When fixed=true is set, whether the original position of the navigation bar should be occupied * @default true */ placeholder?: boolean; /** * 额外渲染元素,与inner平级 * @en Additional render elements, level with inner */ extra?: ReactNode; /** * 自定义滚动元素,不传默认是window * @en Custom scrolling element, default is window if not input */ getScrollContainer?: () => HTMLElement | Window | null; /** * 根据滚动offset值设置自定义style,设置该属性后将监听滚动容器的滚动事件 * @en Set a custom style according to the scroll offset value. After setting this property, the scroll event of the scroll container will be monitored. */ getComputedStyleByScroll?: (offset: number) => CSSProperties; /** * 滚动时回调,设置该属性后将监听滚动容器的滚动事件 * @en Callback when scrolling. After setting this property, the scroll event of the scroll container will be monitored. */ onScrollChange?: (offset: number) => void; /** * 无障碍aria-label属性 * @en Accessibility attribute aria-label * @default "" */ ariaLabel?: string; /** * 无障碍role属性 * @en Accessibility attribute role * @default "banner" */ ariaRole?: string; } /** * 导航栏组件,支持吸顶和沉浸式,支持在指定滚动位置展示,支持根据滚动位置实时更新style。 * @en Navigation bar, supports ceiling and immersion, supports display at specified scroll position, and supports real-time update of style according to scroll position. * @type 导航 * @type_en Navigation * @name 导航栏 * @name_en NavBar */ declare const NavBar: React.ForwardRefExoticComponent>; export default NavBar;