UNPKG

@ray-js/smart-ui-typings

Version:

@ray-js/smart-ui 智能小程序 UI 框架的类型声明文件

76 lines (75 loc) 1.82 kB
/// <reference types="react" /> /// <reference types="wechat-miniprogram" /> import { VantComponent, VantEventHandler } from '../base'; export interface VantSwipeCellProps { /** * 标识符,可以在 `close` 事件的参数中获取到 */ name?: string | number; /** * 左侧滑动区域宽度 * * @default 0 */ leftWidth?: number; /** * 右侧滑动区域宽度 * * @default 0 */ rightWidth?: number; /** * 是否异步关闭 * * @default false */ asyncClose?: boolean; /** * 是否禁用滑动 * * @version `v1.3.4` * * @default false */ disabled?: boolean; /** * 左右侧的按钮 */ slot: { left?: React.ReactNode; right?: React.ReactNode; }; } export type VantSwipeCellPosition = 'left' | 'right'; export type VantSwipeCellClickPosition = VantSwipeCellPosition | 'cell' | 'outside'; /** * @deprecated */ export interface VantSwipeCellClickEvent extends WechatMiniprogram.BaseEvent { detail: VantSwipeCellClickPosition; } export interface VantSwipeCellBaseEventDetail { name: string | number; position: VantSwipeCellPosition; } export interface VantSwipeCellCloseEventDetail extends VantSwipeCellBaseEventDetail { /** * SwipeCell 实例 */ instance: Record<string, any>; } export interface VantSwipeCellEvents { /** * 点击时触发 */ onClick?: VantEventHandler<VantSwipeCellClickPosition>; /** * 关闭时触发 */ onClose?: VantEventHandler<VantSwipeCellCloseEventDetail>; /** * 打开时触发 */ onOpen?: VantEventHandler<VantSwipeCellBaseEventDetail>; } export type VantSwipeCell = VantComponent<VantSwipeCellProps, VantSwipeCellEvents>;