import { ContentState } from 'draft-js' ; export default ( contentState , startKey , endKey ) : Immutable . Iterable < number , string > => { const blockMapKeys = contentState . getBlockMap ( ) . keySeq ( ) ; return blockMapKeys . skipUntil ( ( key ) => key === startKey ) . takeUntil ( ( key ) => key === endKey ) . concat ( [ endKey ] ) ; } ;