1 | import React from 'react';
|
2 | import type { ReactNode } from 'react';
|
3 | import { NativeProps } from '../../utils/native-props';
|
4 | import { PropagationEvent } from '../../utils/with-stop-propagation';
|
5 | declare type SideType = 'left' | 'right';
|
6 | export declare type SwipeActionRef = {
|
7 | close: () => void;
|
8 | show: (side?: SideType) => void;
|
9 | };
|
10 | declare type ActionColor = 'light' | 'weak' | 'primary' | 'success' | 'warning' | 'danger';
|
11 | export declare type Action = {
|
12 | key: string | number;
|
13 | text: ReactNode;
|
14 | color?: ActionColor | string;
|
15 | onClick?: (e: React.MouseEvent) => void;
|
16 | };
|
17 | export declare type SwipeActionProps = {
|
18 | rightActions?: Action[];
|
19 | leftActions?: Action[];
|
20 | onAction?: (action: Action, e: React.MouseEvent) => void;
|
21 | closeOnTouchOutside?: boolean;
|
22 | closeOnAction?: boolean;
|
23 | children: ReactNode;
|
24 | stopPropagation?: PropagationEvent[];
|
25 | onActionsReveal?: (side: SideType) => void;
|
26 | } & NativeProps<'--background'>;
|
27 | export declare const SwipeAction: React.ForwardRefExoticComponent<{
|
28 | rightActions?: Action[] | undefined;
|
29 | leftActions?: Action[] | undefined;
|
30 | onAction?: ((action: Action, e: React.MouseEvent) => void) | undefined;
|
31 | closeOnTouchOutside?: boolean | undefined;
|
32 | closeOnAction?: boolean | undefined;
|
33 | children: ReactNode;
|
34 | stopPropagation?: PropagationEvent[] | undefined;
|
35 | onActionsReveal?: ((side: SideType) => void) | undefined;
|
36 | } & {
|
37 | className?: string | undefined;
|
38 | style?: (React.CSSProperties & Partial<Record<"--background", string>>) | undefined;
|
39 | tabIndex?: number | undefined;
|
40 | } & React.AriaAttributes & React.RefAttributes<SwipeActionRef>>;
|
41 | export {};
|
42 |
|
\ | No newline at end of file |