import { ISegment } from "@fluidframework/merge-tree" ; export function getSegmentRange ( position , segment , startOffset = 0 ) { const start = position - Math . max ( startOffset , 0 ) ; return { start , end : start + segment . cachedLength } ; }