generated from react-component/portal
-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathinterface.ts
92 lines (86 loc) · 2.78 KB
/
interface.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import type { TriggerProps } from '@rc-component/trigger';
import type { PlacementType } from './placements';
import type { CSSProperties, ReactNode } from 'react';
import type { Gap } from './hooks/useTarget';
import { type DefaultPanelProps } from './TourStep/DefaultPanel';
export type SemanticName =
| 'section'
| 'footer'
| 'actions'
| 'header'
| 'title'
| 'description'
| 'mask';
export type HTMLAriaDataAttributes = React.AriaAttributes & {
[key: `data-${string}`]: unknown;
} & Pick<React.HTMLAttributes<HTMLDivElement>, 'role'>;
export interface TourStepInfo {
arrow?: boolean | { pointAtCenter: boolean };
target?: HTMLElement | (() => HTMLElement) | null | (() => null);
title: ReactNode;
description?: ReactNode;
placement?: PlacementType;
mask?:
| boolean
| {
style?: React.CSSProperties;
// to fill mask color, e.g. rgba(80,0,0,0.5)
color?: string;
};
className?: string;
style?: CSSProperties;
scrollIntoViewOptions?: boolean | ScrollIntoViewOptions;
closeIcon?: ReactNode;
closable?: boolean | ({ closeIcon?: ReactNode } & HTMLAriaDataAttributes);
}
export interface TourStepProps extends TourStepInfo {
prefixCls?: string;
total?: number;
current?: number;
onClose?: () => void;
onFinish?: () => void;
renderPanel?: (step: TourStepProps, current: number) => ReactNode;
onPrev?: () => void;
onNext?: () => void;
classNames?: Partial<Record<SemanticName, string>>;
styles?: Partial<Record<SemanticName, React.CSSProperties>>;
}
export interface TourProps extends Pick<TriggerProps, 'onPopupAlign'> {
classNames?: Partial<Record<SemanticName, string>>;
styles?: Partial<Record<SemanticName, React.CSSProperties>>;
className?: string;
style?: React.CSSProperties;
steps?: TourStepInfo[];
open?: boolean;
defaultOpen?: boolean;
defaultCurrent?: number;
current?: number;
onChange?: (current: number) => void;
onClose?: (current: number) => void;
onFinish?: () => void;
closeIcon?: TourStepProps['closeIcon'];
closable?: TourStepProps['closable'];
mask?:
| boolean
| {
style?: React.CSSProperties;
// to fill mask color, e.g. rgba(80,0,0,0.5)
color?: string;
};
arrow?: boolean | { pointAtCenter: boolean };
rootClassName?: string;
placement?: PlacementType;
prefixCls?: string;
renderPanel?: (props: DefaultPanelProps, current: number) => ReactNode;
gap?: Gap;
animated?: boolean | { placeholder: boolean };
scrollIntoViewOptions?: boolean | ScrollIntoViewOptions;
zIndex?: number;
getPopupContainer?: TriggerProps['getPopupContainer'] | false;
builtinPlacements?:
| TriggerProps['builtinPlacements']
| ((config?: {
arrowPointAtCenter?: boolean;
}) => TriggerProps['builtinPlacements']);
disabledInteraction?: boolean;
}