import { register } from '../editor/commands' ; import type { ModelPrivate } from './model-private' ; import { deleteForward , deleteBackward , deleteRange } from './delete' ; import { wordBoundaryOffset } from './commands' ; register ( { deleteAll : ( model ) : boolean => { return deleteRange ( model , [ 0 , - 1 ] ) ; } , deleteForward : ( model ) : boolean => deleteForward ( model ) , deleteBackward : ( model ) : boolean => deleteBackward ( model ) , deleteNextWord : ( model ) : boolean => deleteRange ( model , [ model . anchor , wordBoundaryOffset ( model , model . position , 'forward' ) , ] ) , deletePreviousWord : ( model ) : boolean => deleteRange ( model , [ model . anchor , wordBoundaryOffset ( model , model . position , 'backward' ) , ] ) , deleteToGroupStart : ( model ) : boolean => deleteRange ( model , [ model . anchor , model . offsetOf ( model . at ( model . position ) . firstSibling ) , ] ) , deleteToGroupEnd : ( model ) : boolean => deleteRange ( model , [ model . anchor , model . offsetOf ( model . at ( model . position ) . lastSibling ) , ] ) , deleteToMathFieldStart : ( model ) : boolean => deleteRange ( model , [ model . anchor , 0 ] ) , deleteToMathFieldEnd : ( model ) : boolean => deleteRange ( model , [ model . anchor , - 1 ] ) , } , { target : 'model' , category : 'delete' } ) ;