import { NoteActions } from "./NoteActions" ; export namespace NoteActionSelections { /**
     * Compute a cursor selection based on the current cursor or return undefined undefined.
     */ export function computeCursorRange ( ) { const selection = getSelection ( ) ; if ( selection ) { const range = selection . getRangeAt ( 0 ) ; return range ; } return undefined ; } export function hasActivePrompt ( range ) { return true ; } export function computePromptFromSelection ( start ) { const range = computeCursorRange ( ) ; if ( range !== undefined ) { const text = range . startContainer . nodeValue ; if ( text !== null ) { const end = range . startOffset ; return NoteActions . computePromptFromText ( text , start , end ) ; } } return undefined ; } }