import { TaskTypes , TasksActionTypes , ADD_TASK_LIST , CardTypes , ADD_TASK_CARD , DRAG_LIST , EDIT_TASK_TITLE , EDIT_TASK_CARD_TEXT , EDIT_TASK_CARD_DESCRIPTION , REMOVE_TASK_CARD , REMOVE_TASK_LIST , SET_TASK_LIST_PRIORITY , SET_TASK_CARD_DONE , SKIP_TASK_CARD , SET_TASK_CARD_NOT_DONE , } from "./types" ; export const addTaskList = ( title ) : TasksActionTypes => { return { type : ADD_TASK_LIST , payload : title , } ; } ; export const removeTaskList = ( listId ) : TasksActionTypes => { return { type : REMOVE_TASK_LIST , payload : listId , } ; } ; export const setTaskListPriority = ( listId ) : TasksActionTypes => { return { type : SET_TASK_LIST_PRIORITY , payload : { listId } , } ; } ; export const editTaskTitle = ( listId , listTitle ) : TasksActionTypes => { return { type : EDIT_TASK_TITLE , payload : { listId , listTitle } , } ; } ; export const addTaskCard = ( listId , cardText ) : TasksActionTypes => { return { type : ADD_TASK_CARD , payload : { listId , cardText } , } ; } ; export const editTaskCardText = ( listId , cardId , cardText ) : TasksActionTypes => { return { type : EDIT_TASK_CARD_TEXT , payload : { listId , cardId , cardText } , } ; } ; export const editTaskCard = ( listId , cardId , description ? ) : TasksActionTypes => { return { type : EDIT_TASK_CARD_DESCRIPTION , payload : { listId , cardId , description } , } ; } ; export const removeTaskCard = ( listId ? , cardId ? ) : TasksActionTypes => { return { type : REMOVE_TASK_CARD , payload : { listId , cardId } , } ; } ; export const setTaskCardDone = ( listId ? , cardId ? ) : TasksActionTypes => { return { type : SET_TASK_CARD_DONE , payload : { listId , cardId } , } ; } ; export const setTaskCardNotDone = ( listId ? , cardId ? ) : TasksActionTypes => { return { type : SET_TASK_CARD_NOT_DONE , payload : { listId , cardId } , } ; } ; export const skipTaskCard = ( listId ? ) : TasksActionTypes => { return { type : SKIP_TASK_CARD , payload : { listId } , } ; } ; export const dragList = ( sourceId , destinationId , sourceIndex , destinationIndex , draggableId , type ) : TasksActionTypes => { return { type : DRAG_LIST , payload : { sourceId , destinationId , sourceIndex , destinationIndex , draggableId , type , } , } ; } ;