export interface BinaryModalAttributes { prompt : string ; yesButtonText : string ; noButtonText : string ; onYesButtonClick : ( ) => void ; onNoButtonClick : ( ) => void ; } /**
 * An immediately invoked function expression that returns an object with
 * actions that operate on closed-over state.
 *
 * State in this file corresponds to UI properties.
 * See return object for action functions.
 */ export default ( ( ) => { type ModalType = ( 'none' | 'addChild' | 'addSibling' | 'binaryModal' | 'editNode' | 'fileExport' | 'fileImport' | 'fileOpen' | 'fileSave' | 'miscFileOps' ) ; type MenuType = 'edit' | 'file' | 'moveNode' | 'sizeSettings' | 'undoRedo' ; interface State { binaryModalAttrs ? : BinaryModalAttributes ; currentMenu : MenuType ; currentModal : ModalType ; fontSize : number ; resetDueToNewDoc : boolean ; sidebarIsVisible : boolean ; } const state = { binaryModalAttrs : undefined , currentMenu : 'edit' , currentModal : 'none' , fontSize : 14 , resetDueToNewDoc : false , sidebarIsVisible : false , } ; return { getBinaryModalAttrs : ( ) => state . binaryModalAttrs , setBinaryModalAttrs : ( attrs ) => { state . binaryModalAttrs = attrs ; } , getCurrentMenu : ( ) => state . currentMenu , setCurrentMenu : ( menu ) => { state . currentMenu = menu ; } , getCurrentModal : ( ) => state . currentModal , setCurrentModal : ( modal ) => { state . currentModal = modal ; } , getCurrentFontSize : ( ) => state . fontSize , setCurrentFontSize : ( newSize ) => { state . fontSize = newSize ; } , getSidebarIsVisible : ( ) => state . sidebarIsVisible , setSidebarVisibility : ( visible ) => { state . sidebarIsVisible = visible ; } , getResetDueToNewDoc : ( ) => state . resetDueToNewDoc , setResetDueToNewDoc : ( value ) => { state . resetDueToNewDoc = value ; } , } ; } ) ( ) ;