import { Action } from 'typescript-fsa' ; import { Dispatch } from 'redux' ; import { KanbanRecord , ConfirmDialogProps , AppState } from '../types' ; import { AppEventsActions as AppEventsActions_ , appEventsActions } from '../actions/AppEventsActions' ; import { CalendarActions as CalendarActions_ , calendarActions } from '../actions/CalendarActions' ; import { KanbanBoardActions as KanbanBoardActions_ , kanbanBoardActions } from '../actions/KanbanBoardActions' ; export type AppEventsActions = AppEventsActions_ ; export type CalendarActions = CalendarActions_ ; export type KanbanBoardActions = KanbanBoardActions_ ; export function mapDispatchToProps ( dispatch ) { return { showToday : ( ) => dispatch ( calendarActions . showToday ( ) ) , showNextMonth : ( ) => dispatch ( calendarActions . showNextMonth ( ) ) , showPreviousMonth : ( ) => dispatch ( calendarActions . showPreviousMonth ( ) ) , showNextYear : ( ) => dispatch ( calendarActions . showNextYear ( ) ) , showPreviousYear : ( ) => dispatch ( calendarActions . showPreviousYear ( ) ) , showAlertDialog : ( v ) => dispatch ( appEventsActions . showAlertDialog ( v ) ) , closeAlertDialog : ( ) => dispatch ( appEventsActions . closeAlertDialog ( ) ) , changeActiveBoard : ( boardId ) => dispatch ( kanbanBoardActions . startChangeActiveBoard ( Object . assign ( { } , { boardId } , { dispatch } ) ) ) , updateBoardName : ( v ) => dispatch ( kanbanBoardActions . startUpdateBoardName ( v ) ) , updateSticky : ( v ) => dispatch ( kanbanBoardActions . startUpdateSticky ( Object . assign ( { } , v , { dispatch } ) ) ) , archiveSticky : ( kanbanId ) => dispatch ( kanbanBoardActions . startArchiveSticky ( { kanbanId } ) ) , unarchiveSticky : ( kanbanId ) => dispatch ( kanbanBoardActions . startUnarchiveSticky ( { kanbanId } ) ) , deleteSticky : ( kanbanId ) => dispatch ( kanbanBoardActions . startDeleteSticky ( Object . assign ( { } , { kanbanId } , { dispatch } ) ) ) , } ; } export function mapStateToProps ( appState ) { return Object . assign ( { } , { kanbanBoardState : appState . kanbanBoard } , appState . calendar ) ; }