import React from 'react'; import { OpenBaseProps } from '../masking'; import { DirectionType, PopupProps, PopupRef } from '../popup'; export interface PopupSwiperProps extends PopupProps { /** * 滑动超过内容的百分之多少时关闭弹窗,范围为[0, 1],如果该属性和`distanceToClose`属性均设置,则实际计算结果更大的生效 * @en Close the popup when sliding more than the percentage of the content, the range is [0, 1]. If both this property and the `distanceToClose` property are set, the larger the actual calculation result takes effect * @default 0.3 */ percentToClose?: number; /** * 滑动超过多少px时关闭弹窗,如果该属性和`percentToClose`属性均设置,则实际计算结果更大的生效 * @en Close the popup when sliding more than px, if this property and the `percentToClose` property are both set, the larger the actual calculation result takes effect. * @default 10 */ distanceToClose?: number; /** * 手指从按下到抬起之间的滑动速度超过多少时关闭弹窗(单位为px/s),与滑动关闭距离阈值同时设置时,满足其中一个即生效 * @en Close the popup when the finger slides between pressing and lifting (unit: px/s). When it is set at the same time as the sliding closing distance threshold, it will take effect if one of them is satisfied. * @default 200 */ speedToClose?: number; /** * 自定义可手势滑动退出的方向,可指定多个方向 * @en Custom direction of the gesture swipe exit, you can specify multiple directions * @default direction 属性指定的方向性 * @default_en The value of direction property */ allowSwipeDirections?: DirectionType[]; /** * 固定弹窗退出方向,默认跟随手势滑动方向 * @en Fixed the exit direction of the pop-up window, and the default sliding direction follows the gesture */ exitDirection?: DirectionType; /** * 内容面板 touchstart 事件,返回true时表示阻止本组件内部处理事件 * @en The touchstart callback of content panel. When it returns true, it means that the event is prevented from being processed inside the component */ onTouchStart?: (e: TouchEvent) => void | boolean; /** * 内容面板 touchmove 事件,返回true时表示阻止本组件内部处理事件 * @en The touchmove callback of content panel. When it returns true, it means that the event is prevented from being processed inside the component */ onTouchMove?: (e: TouchEvent, prevented: boolean, direction: 'x' | 'y') => void | boolean; /** * 内容面板 touchend / touchcancel 事件,返回true时表示阻止本组件内部处理事件 * @en The touchend / touchcancel callback of content panel. When it returns true, it means that the event is prevented from being processed inside the component */ onTouchEnd?: (e: TouchEvent) => void | boolean; } export interface PopupSwiperRef extends PopupRef { } export declare function methodsGenerator
(Comp: React.FunctionComponent
): { /** * 打开弹出层 * @desc {en} Open the PopupSwiper * @param {string | PopupSwiperProps} config Configuration * @returns {{ close: () => void; update: (newConfig: PopupSwiperProps) => void; }} */ open: (config: Pick
> & { key?: string | undefined; }, context?: import("../context-provider").GlobalContextParams | undefined) => { close: () => void; update: (newConfig: Pick
> & {
key?: string | undefined;
}) => void;
};
};
declare const _default: React.ForwardRefExoticComponent