Skip to content
This repository was archived by the owner on Dec 24, 2019. It is now read-only.

Commit 28d05bb

Browse files
author
Clark Bynum
authored
Update index.d.ts
1 parent 29f19a7 commit 28d05bb

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

index.d.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ interface StyleFactoryFn {
44
(index: number, style: object | void, notification: NotificationProps): object;
55
}
66

7-
interface NotificationProps {
7+
interface OnClickNotificationProps {
8+
/**
9+
* Callback function to run when the action is clicked.
10+
* @param notification Notification currently being clicked
11+
* @param deactivate Function that can be called to set the notification to inactive.
12+
* Used to activate notification exit animation on click.
13+
*/
14+
onClick?(notification: NotificationProps, deactivate: () => void): void;
15+
}
16+
17+
interface NotificationProps extends OnClickNotificationProps {
818
/** The name of the action, e.g., "close" or "undo". */
919
action?: string;
1020
/** Custom action styles. */
@@ -38,21 +48,15 @@ interface NotificationProps {
3848
title?: string | ReactElement<any>;
3949
/** Custom title styles. */
4050
titleStyle?: object;
41-
/**
42-
* Callback function to run when the action is clicked.
43-
* @param notification Notification currently being clicked
44-
* @param deactivate Function that can be called to set the notification to inactive.
45-
* Used to activate notification exit animation on click.
46-
*/
47-
onClick?(notification: NotificationProps, deactivate: () => void): void;
51+
4852
/**
4953
* Callback function to run when dismissAfter timer runs out
5054
* @param notification Notification currently being dismissed.
5155
*/
5256
onDismiss?(notification: NotificationProps): void;
5357
}
5458

55-
interface NotificationStackProps {
59+
interface NotificationStackProps extends OnClickNotificationProps {
5660
/** Create the style of the actions. */
5761
actionStyleFactory?: StyleFactoryFn;
5862
/** Create the style of the active notification. */

0 commit comments

Comments
 (0)