import { RenderFunction, SetupContext, Ref } from 'vue' import { DefineVxeComponentApp, DefineVxeComponentOptions, DefineVxeComponentInstance, VxeComponentBaseOptions, VxeComponentEventParams, ValueOf, VxeComponentSizeType, VxeComponentStyleType, VxeUseInitVScrollbarReactData, VxeUseInitVScrollbarInternalData } from '@vxe-ui/core' /* eslint-disable no-use-before-define,@typescript-eslint/ban-types */ export declare const VxeScrollbar: DefineVxeComponentApp export type VxeScrollbarComponent = DefineVxeComponentOptions export type VxeScrollbarInstance = DefineVxeComponentInstance export interface VxeScrollbarConstructor extends VxeComponentBaseOptions, VxeScrollbarMethods { props: VxeScrollbarProps context: SetupContext reactData: ScrollbarReactData internalData: ScrollbarInternalData getRefMaps(): ScrollbarPrivateRef getComputeMaps(): ScrollbarPrivateComputed renderVN: RenderFunction } export interface ScrollbarPrivateRef { refElem: Ref } export interface VxeScrollbarPrivateRef extends ScrollbarPrivateRef {} export namespace VxeScrollbarPropTypes { export type Size = VxeComponentSizeType export type Id = number | string export type ViewId = number | string export type Theme = '' | 'light' | 'dark' export type Width = number | string export type Height = number | string export type MinWidth = number | string export type MinHeight = number | string export type MaxWidth = number | string export type MaxHeight = number | string export type Loading = boolean export type Native = boolean export type Padding = boolean export type AutoHide = boolean export type FluentOverlay = boolean export type Visible = boolean export interface XConfig { height?: number | string // showArrows?: boolean /** * 是否自动隐藏滚动条 */ autoHide?: boolean /** * 滚动条显示位置 */ position?: 'top' | 'bottom' | '' visible?: boolean /** * 滚动到边界触发的阈值会触发 scroll-boundary 事件 */ threshold?: string | number } export interface YConfig { width?: number | string // showArrows?: boolean /** * 是否自动隐藏滚动条 */ autoHide?: boolean /** * 滚动条显示位置 */ position?: 'left' | 'right' | '' visible?: boolean /** * 滚动到边界触发的阈值会触发 scroll-boundary 事件 */ threshold?: string | number } export type ClassName = string export type ViewAttrs = Record export type ViewStyle = VxeComponentStyleType export type ViewClassName = string export type ViewInnerClassName = string /** * 已废弃 * @deprecated */ export type AutoResize = boolean /** * 已废弃 * @deprecated */ export type SyncResize = boolean } export interface VxeScrollbarProps { size?: VxeScrollbarPropTypes.Size /** * ID */ id?: VxeScrollbarPropTypes.Id /** * View ID */ viewId?: VxeScrollbarPropTypes.ViewId /** * 主题色 */ theme?: VxeScrollbarPropTypes.Theme /** * 容器宽度 */ width?: VxeScrollbarPropTypes.Width /** * 容器最小高度 */ height?: VxeScrollbarPropTypes.Height /** * 容器最小宽度 */ minWidth?: VxeScrollbarPropTypes.MinWidth /** * 容器最大高度 */ minHeight?: VxeScrollbarPropTypes.MinHeight /** * 容器最大宽度 */ maxWidth?: VxeScrollbarPropTypes.MaxWidth /** * 容器高度 */ maxHeight?: VxeScrollbarPropTypes.MaxHeight /** * 是否加载中 */ loading?: VxeScrollbarPropTypes.Loading /** * 是否自动隐藏 */ autoHide?: VxeScrollbarPropTypes.AutoHide /** * 是否悬浮叠加滚动条,默认细线,鼠标悬浮上去滑块变宽 */ fluentOverlay?: VxeScrollbarPropTypes.FluentOverlay /** * 是否显示 */ visible?: VxeScrollbarPropTypes.Visible /** * 是否使用原生滚动条 */ native?: VxeScrollbarPropTypes.Native /** * 滚动条是否需要边距 */ padding?: VxeScrollbarPropTypes.Padding /** * 纵向滚动条宽度 */ xConfig?: VxeScrollbarPropTypes.XConfig /** * 横向滚动条高度 */ yConfig?: VxeScrollbarPropTypes.YConfig /** * 给容器附加 class */ className?: VxeScrollbarPropTypes.ClassName /** * 给视图元素附加属性 */ viewAttrs?: VxeScrollbarPropTypes.ViewAttrs /** * 给视图元素附加样式 */ viewStyle?: VxeScrollbarPropTypes.ViewStyle /** * 给视图元素附加 class */ viewClassName?: VxeScrollbarPropTypes.ViewClassName /** * 给视图内元素附加 class */ viewInnerClassName?: VxeScrollbarPropTypes.ViewInnerClassName /** * 自动监听元素的变化去重新计算样式 * @deprecated */ autoResize?: VxeScrollbarPropTypes.AutoResize /** * 自动跟随某个属性的变化去重新计算表格,和手动调用 recalculate 方法是一样的效果(对于通过某个属性来更新内容时可能会用到) * @deprecated */ syncResize?: VxeScrollbarPropTypes.SyncResize } export interface ScrollbarPrivateComputed {} export interface VxeScrollbarPrivateComputed extends ScrollbarPrivateComputed {} export interface ScrollbarReactData extends VxeUseInitVScrollbarReactData {} export interface ScrollbarInternalData extends VxeUseInitVScrollbarInternalData {} export interface ScrollbarMethods { dispatchEvent(type: ValueOf, params: Record, evnt: Event | null): void /** * 滚动到指定位置 */ scrollTo(options: ScrollToOptions): void scrollTo(left: number, top: number): void /** * 设置顶部滚动距离 */ setScrollTop(top: number): void /** * 设置左侧滚动距离 */ setScrollLeft(left: number): void /** * 获取顶部滚动距离 */ getScrollTop(top: number): number /** * 获取左侧滚动距离 */ getScrollLeft(left: number): number /** * 清除滚动条距离 */ clearScroll(): void /** * 滚动元素到可见位置 */ scrollIntoView(): void /** * 获取滚动视图元素 */ getScrollViewElem(): HTMLElement | null | undefined /** * 获取滚动视图内容包裹元素 */ getScrollViewInnerElem(): HTMLElement | null | undefined /** * 重新计算样式 * 对于某些特殊场景可能会用到,比如更新内容 */ recalculate(): Promise } export interface VxeScrollbarMethods extends ScrollbarMethods {} export interface ScrollbarPrivateMethods {} export interface VxeScrollbarPrivateMethods extends ScrollbarPrivateMethods {} export type VxeScrollbarEmits = ['scroll', 'scroll-boundary'] export namespace VxeScrollbarDefines { export interface ScrollbarEventParams extends VxeComponentEventParams { $scrollbar: VxeScrollbarConstructor } export interface ScrollEventParams extends ScrollbarEventParams { direction: 'top' | 'bottom' | 'left' | 'right' isTop: boolean isBottom: boolean isLeft: boolean isRight: boolean scrollTop: number scrollLeft: number clientWidth: number clientHeight: number scrollHeight: number scrollWidth: number } export interface ScrollBoundaryEventParams extends ScrollEventParams {} } export type VxeScrollbarEventProps = { onScroll?: VxeScrollbarEvents.Scroll onScrolllBoundary?: VxeScrollbarEvents.ScrollBoundary } export interface VxeScrollbarListeners { scroll?: VxeScrollbarEvents.Scroll scrolllBoundary?: VxeScrollbarEvents.ScrollBoundary } export namespace VxeScrollbarEvents { export type Scroll = (params: VxeScrollbarDefines.ScrollEventParams) => void export type ScrollBoundary = (params: VxeScrollbarDefines.ScrollBoundaryEventParams) => void } export namespace VxeScrollbarSlotTypes { export interface DefaultSlotParams {} } export interface VxeScrollbarSlots { default?: (params: VxeScrollbarSlotTypes.DefaultSlotParams) => any } export const Scrollbar: typeof VxeScrollbar export default VxeScrollbar