import { INotebook } from './types' ; import { ExtractActionTypes , ExtractActions } from '../common/actions' ; import { IFilePathItem } from '../file' ; export const NotebookActions = { createNotebook : ( id , notebook ) => ( { type : 'notebook.create' as const , notebook , id , } ) , deleteNotebook : ( id ) => ( { type : 'notebook.delete' as const , id , } ) , deleteNotebookNotes : ( id ) => ( { type : 'notebook.deleteNotes' as const , id , } ) , moveNotebook : ( id , newPath ) => ( { type : 'notebook.update.path' as const , id , path : newPath , } ) , updateName : ( id , name ) => ( { type : 'notebook.update.name' as const , name , id , } ) , toggleIsLiked : ( id , isLiked ) => ( { type : 'notebook.update.isLiked' as const , id , isLiked , } ) , } ; export type NotebookActions = ExtractActions < typeof NotebookActions > ; export type NotebookActionTypes = ExtractActionTypes < typeof NotebookActions > ; export const NotebookActionTypes = ExtractActionTypes ( NotebookActions ) ;