import { BackgroundDisplay , WidgetDisplay } from "../reducers/types" ; export function setBackground ( key , from ? ) { return { type : "SET_BACKGROUND" , data : { key , from } , } as const ; } export function addWidget ( key ) { return { type : "ADD_WIDGET" , data : { key } , } as const ; } export function removeWidget ( id ) { return { type : "REMOVE_WIDGET" , data : { id } , } as const ; } export function reorderWidget ( id , to ) { return { type : "REORDER_WIDGET" , data : { id , to } , } as const ; } export function setData ( id , data ) { return { type : "SET_DATA" , data : { id , data } , } as const ; } export function setBackgroundDisplay ( display ) { return { type : "SET_BACKGROUND_DISPLAY" , data : { display } , } as const ; } export function setLocale ( locale ) { return { type : "SET_LOCALE" , data : { locale } , } as const ; } export function setTimeZone ( timeZone ? ) { return { type : "SET_TIME_ZONE" , data : { timeZone } , } as const ; } export function setWidgetDisplay ( id , display ) { return { type : "SET_WIDGET_DISPLAY" , data : { id , display } , } as const ; } export type DataActions = ReturnType < typeof setBackground > | ReturnType < typeof addWidget > | ReturnType < typeof removeWidget > | ReturnType < typeof reorderWidget > | ReturnType < typeof setData > | ReturnType < typeof setBackgroundDisplay > | ReturnType < typeof setLocale > | ReturnType < typeof setTimeZone > | ReturnType < typeof setWidgetDisplay > ;