ixfx
    Preparing search index...

    Module @ixfx/collections - v0.56.10

    @ixfx/collections npm

    Please refer to README.md

    Namespaces

    Graphs

    Undirected and directed graphs and associated algorithms.

    Maps

    Maps associate keys with values.

    Queues

    Queues store items in the order in which they are added.

    Sets

    Sets store unique items.

    Stacks

    Stacks store items in order, like a stack of plates.

    Trees

    A tree-like structure of branches and leaves.

    Functions

    applyToPositions

    Applies fn to both start and end fields, returning a new event.

    arrayFromItems

    Converts a collection of IndexedEventItem back into an array of EventItem, placing items at their original index.

    compareRange

    Returns how b overlaps with a.

    computeRange

    Gets the range of events: the smallest 'start' and the largest 'end'.

    createFromStarts
    defragment

    Lays out events end-to-end, removing gaps between them and having the first start at 0. Duration of events is maintained.

    fromDuration

    Creates an EventItem from an EventItemAsDuration by calculating the end as start + duration.

    holepunch

    Punches a hole in sortedEvents which overlap hole. It does this by splitting/trimming events, or removing an event entirely it is fully covered by the hole.

    insertSpace

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

    intervals

    Returns the intervals between pairs of events.

    isEmpty

    Returns true if item has zero duration (start and end are the same), false otherwise.

    isEventItem
    isObjectKeys
    isValid
    itemsWithEnd

    Yields every item in eventsByEnd that has the specified end value. Return item is a wrapped object consisting of the event as well as its index.

    itemsWithStart

    Yields every item in sortedEvents that has the specified start value

    overlapping

    Yields all events that overlap with point. By default event end is considered exclusive, meaning that if point == event.end, it is not considered overlapping. If endInclusive is true, event end is considered inclusive, and the aforementioned would be considered ovlerapping.

    remove

    Removes toRemove from sortedEvents.

    sortByEnd

    Returns a new array of events ordered by their end time (ascending)

    sortByStart

    Returns a new array of events ordered by their start time (ascending)

    splitEvent

    Splits event into two events by either a percentange of duration or by a specific start position.

    sumDuration

    Returns the total duration of all events. Doesn't take into account the spacing between events, just sums the duration of each one.

    toDuration

    Creats an EventItemAsDuration from an EventItem by calculating the duration as end - start.

    translate

    Translates an event by adding amount to both start and end, returning a new event.

    Classes

    CircularArray

    A circular array keeps a maximum number of values, overwriting older values as needed. Immutable.

    ExpiringMap

    A map that can have a capacity limit. The elapsed time for each get/set operation is maintained allowing for items to be automatically removed. has() does not affect the last access time.

    QueueImmutable

    Queue (immutable). See also QueueMutable.

    QueueMutable

    Mutable queue that fires events when manipulated.

    Table

    Stores values in a table of rows (vertical) and columns (horizontal)

    Interfaces

    ICircularArray
    ISetImmutable

    A Set which stores unique items determined by their value, rather than object reference (unlike the default JS Set). Create with Sets.mutable. Immutable.

    ISetMutable

    A Set which stores unique items determined by their value, rather than object reference (unlike the default JS Set). Create with Sets.mutable. Mutable.

    References

    IStackImmutable → Stacks.IStackImmutable
    MapOfSimpleMutable → Maps.MapOfSimpleMutable
    SetStringImmutable → Sets.SetStringImmutable
    SetStringMutable → Sets.SetStringMutable
    StackImmutable → Stacks.StackImmutable
    StackMutable → Stacks.StackMutable

    Type Aliases

    ArrayKeys

    Key-value pairs in an array

    DefragmentOptions
    EitherKey

    Type that represents key-values in object or array form

    EventInterval
    EventItem
    EventItemAsDuration
    IdEventItem
    IndexedEventItem
    LabelledNode

    A node with an accompanying label

    LabelledSingleValue

    A value that is labelled

    LabelledValue

    A labelled single value or array of values

    LabelledValues

    A label for any number of values

    ObjectKeys

    Key-value pairs in object form

    QueueDiscardPolicy
    QueueOpts

    Queue options.

    SimplifiedNode

    A simplified node has its parentage stripped.

    SplitOptions
    SplitOptionsAbsolute
    SplitOptionsRelative
    TableRow

    A row of table values

    TableValue

    A table value or undefined

    TraversableTree

    Traversable Tree.

    TraverseObjectEntry
    TraverseObjectEntryStatic
    TraverseObjectEntryWithAncestors
    TraverseObjectPathOpts

    Options for parsing a path

    TreeNode

    Array-backed tree node.

    ValueSetEventMap
    WrappedNode

    Wraps a TreeNode for a more object-oriented means of access.

    Variables

    CompareByEnd

    Sorts by end, such that 'end' values are ascending.

    CompareByEndOnly
    CompareByStart

    Sorts by start, such that 'start' values are ascending.

    CompareByStartOnly