import { ScrollListState, ScrollListScrollState } from './reducers' export const SCROLL_LIST_SCROLL = '@@cosmo_ui/SCROLL_LIST_SCROLL' export const SCROLL_LIST_UPDATE = '@@cosmo_ui/SCROLL_LIST_UPDATE' export const SCROLL_LIST_JUMP = '@@cosmo_ui/SCROLL_LIST_JUMP' export interface ScrollListScrollAction { type: '@@cosmo_ui/SCROLL_LIST_SCROLL' id: string scroll: ScrollListScrollState } export interface ScrollListUpdateAction { type: '@@cosmo_ui/SCROLL_LIST_UPDATE' id: string scrollList: ScrollListState } export interface ScrollListJumpAction { type: '@@cosmo_ui/SCROLL_LIST_JUMP' id: string idx: number } export type ScrollListAction = ScrollListScrollAction | ScrollListUpdateAction | ScrollListJumpAction export const scrollListScroll = (id: string, scroll: ScrollListScrollState): ScrollListScrollAction => ({ type: SCROLL_LIST_SCROLL, id, scroll, }) export const scrollListUpdate = (id: string, scrollList: ScrollListState): ScrollListUpdateAction => ({ type: SCROLL_LIST_UPDATE, id, scrollList, }) export const scrollListJump = (id: string, idx: number): ScrollListJumpAction => ({ type: SCROLL_LIST_JUMP, id, idx, })