-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.d.ts
More file actions
65 lines (57 loc) · 1.5 KB
/
types.d.ts
File metadata and controls
65 lines (57 loc) · 1.5 KB
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
import * as React from 'react';
type VoidFunction = (...args: any[]) => void;
interface ModalTriggerProps {
isOpen: boolean;
toggle: VoidFunction;
close: VoidFunction;
open: VoidFunction;
}
export interface ModalProps {
/**
* Modal trigger
* @default undefined
*/
children?: React.ReactChildren | ((props: ModalTriggerProps) => React.ReactChildren);
/**
* Modal content
* @default undefined
*/
content?: React.ReactChildren | (({ close: VoidFunction }) => React.ReactChildren);
/**
* Modal content className
* @default undefined
*/
className?: string;
/**
* Event, fired on modal close
* @default () => {}
*/
onClose?: VoidFunction;
/**
* Whether close modal on Escape button press or not
* @default true
*/
closeOnEscape?: boolean;
/**
* Whether close modal on Enter button press or not
* @default false
*/
closeOnEnter?: boolean;
/**
* Whether close modal on remote click or not
* @default true
*/
closeOnRemoteClick?: boolean;
/**
* Tag for modal trigger (used only if children are not a function)
* @default div
*/
tag?: string;
}
export default class Modal extends React.Component<ModalProps> {}
export class ModalsRoot extends React.Component {}
interface ModalsProviderProps {
children: React.ReactChildren
}
export class ModalsProvider extends React.Component<ModalsProviderProps> {}
export const useModal: () => void;