import { OPEN_DRAWER, CLOSE_DRAWER, TOGGLE_DRAWER, } from './constants' export interface OpenDrawerAction { type: '@@cosmo-ui/OPEN_DRAWER' key: string } export interface CloseDrawerAction { type: '@@cosmo-ui/CLOSE_DRAWER' key: string } export interface ToggleDrawerAction { type: '@@cosmo-ui/TOGGLE_DRAWER' key: string } export type DrawerAction = ToggleDrawerAction | OpenDrawerAction | CloseDrawerAction export const openDrawer = (key: string) => ({ key, type: OPEN_DRAWER }) export const closeDrawer = (key: string) => ({ key, type: CLOSE_DRAWER }) export const toggleDrawer = (key: string) => ({ key, type: TOGGLE_DRAWER })