import { DRAWER_UNSELECT } from '../utils/constants' ; export type DrawerState = { visible : boolean ; childrenVisible : boolean ; drawerType : string ; childrenDrawerType : string ; selectedKeys : string [ ] ; } ; const initialState = { childrenVisible : false , visible : false , drawerType : '' , childrenDrawerType : DRAWER_UNSELECT , selectedKeys : [ ] , } ; export const drawer = { state : initialState , reducers : { setVisible ( state , visible ) { state . visible = visible ; return state ; } , setDrawerType ( state , type ) { state . drawerType = type ; return state ; } , setSelectedKeys ( state , keys ) { state . selectedKeys = keys ; return state ; } , setChildrenVisible ( state , visible ) { state . childrenVisible = visible ; return state ; } , setChildrenDrawerType ( state , type ) { state . childrenDrawerType = type ; return state ; } , } , } ;