forked from keystonejs/keystone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact-toast-notifications.js.flow
32 lines (32 loc) · 1.07 KB
/
react-toast-notifications.js.flow
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
declare module 'react-toast-notifications' {
declare type Id = string;
declare type Options = {
appearance?: 'error' | 'info' | 'success',
autoDismiss?: boolean,
};
declare type Callback = (Id) => void;
declare type AddFn = (content: React$Node, options?: Options, cb?: Callback) => void;
declare type RemoveFn = (id: Id, cb?: Callback) => void;
declare type Context = { add: AddFn, remove: RemoveFn };
declare type Placement =
| 'bottom-left'
| 'bottom-center'
| 'bottom-right'
| 'top-left'
| 'top-center'
| 'top-right';
declare type ToastContainerProps = { children: React$Node, placement: Placement };
declare module.exports: {
withToastManager: <Props>(
Comp: React$ComponentType<Props>
) => React$ComponentType<$Diff<Props, { toastManager: Context }>>,
ToastConsumer: React$ComponentType<{ children: Context => React$Node }>,
ToastProvider: React$ComponentType<{
autoDismissTimeout: number,
children: Node,
components: *,
placement: Placement,
transitionDuration: number,
}>,
};
}