| 1 |
/** |
| 2 |
* @since 4.0.0 |
| 3 |
*/ |
| 4 |
export type Notification = { |
| 5 |
id: string; |
| 6 |
content: string | JSX.Element | Function; |
| 7 |
notificationType?: 'notice' | 'snackbar'; |
| 8 |
type?: 'error' | 'warning' | 'info' | 'success'; |
| 9 |
isDismissible?: boolean; |
| 10 |
autoHide?: boolean; |
| 11 |
onDismiss?: () => void; |
| 12 |
duration?: number, |
| 13 |
} |
| 14 |
|
| 15 |
/** |
| 16 |
* @since 4.0.0 |
| 17 |
*/ |
| 18 |
declare module "@wordpress/data" { |
| 19 |
export function select(key: 'givewp/campaign-notifications'): { |
| 20 |
getNotifications(): Notification[], |
| 21 |
getNotificationsByType(type: 'snackbar' | 'notice'): Notification[] |
| 22 |
}; |
| 23 |
|
| 24 |
export function dispatch(key: 'givewp/campaign-notifications'): { |
| 25 |
addSnackbarNotice(notification: Notification): void, |
| 26 |
addNotice(notification: Notification): void, |
| 27 |
dismissNotification(id: string): void |
| 28 |
}; |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* @since 4.0.0 |
| 33 |
*/ |
| 34 |
export type GiveCampaignOptions = { |
| 35 |
isAdmin: boolean; |
| 36 |
adminUrl: string; |
| 37 |
apiRoot: string; |
| 38 |
apiNonce: string; |
| 39 |
campaignsAdminUrl: string;s |
| 40 |
currency: string; |
| 41 |
isRecurringEnabled: boolean; |
| 42 |
defaultForm: string; |
| 43 |
admin: { |
| 44 |
showCampaignInteractionNotice: boolean |
| 45 |
showFormGoalNotice: boolean |
| 46 |
showExistingUserIntroNotice: boolean |
| 47 |
showCampaignListTableNotice: boolean |
| 48 |
showCampaignFormNotice: boolean |
| 49 |
showCampaignSettingsNotice: boolean |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
/** |
| 54 |
* @since 4.0.0 |
| 55 |
*/ |
| 56 |
export type GoalType = |
| 57 |
'amount' |
| 58 |
| 'donations' |
| 59 |
| 'donors' |
| 60 |
| 'amountFromSubscriptions' |
| 61 |
| 'subscriptions' |
| 62 |
| 'donorsFromSubscriptions'; |
| 63 |
|