ixfx
    Preparing search index...

    Function insertSpace

    • Inserts space within sortedEvents. It does this by shifting events forward.

      If start overlaps with existing item(s), overlappingPolicy is used:

      • 'ignore': Event duration is not changed
      • 'stretch': Events that overlap are stretched by length.

      When considering overlap, both end is exclusive and start are considered exclusive.

      Eg, if we have the event { start: 5, end: 10 }.

      • insertSpace(data, 5, 1, ignore); // Would not be considered overlapping, but event would be shifted to { start: 6, end: 11 }
      • insertSpace(data, 10, 1, ignore); // Would not be considered overlapping, event would remain { start: 5, end: 10 }
      • insertSpace(data, 5, 1, stretch); // Would be considered overlapping, event shifted to { start: 6, end: 11 }
      • insertSpace(data, 6, 1, stretch); // Would be considered overlapping, event would be stretched to { start: 5, end: 11 }

      Type Parameters

      • T extends Readonly<{ end: number; start: number }>

      Parameters

      • sortedEvents: T[]
      • start: number
      • length: number
      • overlappingPolicy: "ignore" | "stretch"

      Returns T[]