import { AllowedComponentProps, VNodeProps } from '../common' import type { IconType } from './icon' declare interface NavBarAction { text?: string icon?: string iconSize?: string | number iconColor?: string iconType?: IconType textColor?: string disabled?: boolean badge?: string | number data?: any, click?: Function | undefined } declare interface NavBarProps { // 基础属性 title?: string type?: 'default' | 'search' | 'home' | 'custom' theme?: 'light' | 'dark' | 'primary' | 'transparent' fixed?: boolean border?: boolean transparent?: boolean shadow?: boolean immersive?: boolean // 沉浸式(占位状态栏) safeArea?: boolean // 适配刘海屏安全区域 // 标题相关 titleIcon?: string titleIconSize?: string | number titleIconColor?: string titleRightIcon?: string titleRightIconSize?: string | number titleRightIconColor?: string titleEllipsis?: boolean titleStyle?: Record // 返回按钮 showBack?: boolean backIcon?: string backIconSize?: string | number backIconColor?: string backText?: string delta?: number // 返回的页面数 // 左侧区域 showLeft?: boolean leftIcon?: string leftText?: string // 右侧区域 rightIcon?: string rightText?: string actions?: NavBarAction[] // 图标通用 iconSize?: string | number iconColor?: string // 搜索栏模式 searchValue?: string placeholder?: string placeholderStyle?: string searchFocus?: boolean searchDisabled?: boolean showSearchButton?: boolean searchButtonText?: string // 样式控制 height?: string | number backgroundColor?: string color?: string statusBarColor?: string zIndex?: number // 自定义样式 customStyle?: Record } declare interface NavBarEvents { // 基础事件 'back': [event: MouseEvent] 'left-click': [event: MouseEvent] 'right-click': [event: MouseEvent] 'title-click': [event: MouseEvent] // 搜索事件 'search-input': [value: string, event: any] 'search-focus': [event: any] 'search-blur': [event: any] 'search-confirm': [value: string, event: any] 'search-clear': [] 'search-button-click': [value: string] // 操作事件 'action-click': [action: NavBarAction, index: number] // 生命周期 'init': [] 'ready': [] } declare interface NavBarSlots { // 命名插槽 left?: () => any title?: () => any right?: () => any } declare interface _NavBar { new(): { $props: AllowedComponentProps & VNodeProps & NavBarProps $emit: NavBarEvents $slots: NavBarSlots $exposed?: { focusSearch: () => void blurSearch: () => void clearSearch: () => void getSearchValue: () => string setSearchValue: (value: string) => void } } } export declare const NavBar: _NavBar export default NavBar export type { NavBarAction, NavBarProps, NavBarEvents, NavBarSlots }