import type { ReactNode, CSSProperties } from 'react'; import React from 'react'; import type { PopupProps, PopupRef } from '../popup'; import type { OpenBaseProps } from '../masking'; export interface ActionSheetItemOptions { /** * 选项文字内容 * @en Option text */ content: ReactNode; /** * 状态,disabled 状态下不可点,danger 状态字体飘红 * @en Status, it isn't clickable in disabled status, its font is red in danger status * */ status?: 'normal' | 'disabled' | 'danger'; /** * 选项文字自定义类名 * @en Custom classname for option content */ className?: string; /** * 选项文字自定义样式 * @en Custom stylesheet for option content */ style?: CSSProperties; /** * 点击选项事件,返回值为 true 时可以阻止动作面板关闭 * @en Click option event, actionSheet will be prevent from closing when returning true */ onClick?: (e?: React.MouseEvent) => (void | boolean) | Promise; } export interface ActionSheetProps extends Omit { /** * 选项配置,详情见 ActionSheetItemOptions * @en Option setting, see ActionSheetItemOptions for details */ items: ActionSheetItemOptions[]; /** * 取消按钮内容,传值则会展示,点击后关闭动作面板 * @en Cancel button content, the value will be shown, actionSheet will be closed when clicked */ cancelText?: ReactNode; /** * 面板标题内容 * @en Title content */ title?: ReactNode; /** * 面板副标题内容 * @en Sub title content */ subTitle?: ReactNode; /** * 从底部滑出的菜单内容是否适配ipx底部 * @en Whether the content of the menu that slides out from the bottom fits the bottom of the iphoneX * @default true */ needBottomOffset?: boolean; } export interface ActionSheetRef extends PopupRef { /** * 菜单列表元素 DOM * @en The outermost element DOM */ actionList: HTMLDivElement | null; } export declare function methodsGenerator

(Comp: React.FunctionComponent

): { /** * 打开动作面板 * @desc {en} Open actionsheet * @param {ActionSheetProps} config setting * @returns {{ close: () => void; update: (newConfig: ActionSheetProps) => 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> & { /** * 打开动作面板 * @desc {en} Open actionsheet * @param {ActionSheetProps} config setting * @returns {{ close: () => void; update: (newConfig: ActionSheetProps) => void; }} */ open: (config: Pick>, "ref" | "className" | "title" | "context" | "key" | "translateZ" | "getScrollContainer" | "onTouchMove" | "getContainer" | "items" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "contentTransitionVarType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "cancelText" | "subTitle"> & { key?: string | undefined; }, context?: import("../context-provider").GlobalContextParams | undefined) => { close: () => void; update: (newConfig: Pick>, "ref" | "className" | "title" | "context" | "key" | "translateZ" | "getScrollContainer" | "onTouchMove" | "getContainer" | "items" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "contentTransitionVarType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "cancelText" | "subTitle"> & { key?: string | undefined; }) => void; }; }; /** * 动作面板组件 * @en ActionSheet Component * @type 反馈 * @type_en FeedBack * @name 动作面板 * @name_en ActionSheet */ export default _default;