Interface GenIndex<T, I, G>

Generational index factory.

interface GenIndex<T, I, G> {
    MAX_GENERATION: G;
    create(index?, generation?): T;
    generationOf(id): G;
    indexOf(id): I;
    next(id): T;
    nextGeneration(generation): G;
}

Type Parameters

  • T = number
  • I = number
  • G = number

Properties

MAX_GENERATION: G

The maximum generation value.

Methods

  • Creates a generational index ID from index and generation parts.

    Parameters

    • Optional index: I
    • Optional generation: G

    Returns T

  • Returns the generation part of a generational index ID.

    Parameters

    • id: T

    Returns G

  • Returns the index part of a generational index ID.

    Parameters

    • id: T

    Returns I

  • Returns the same index ID at next generation.

    Parameters

    • id: T

    Returns T

  • Returns the next value for the given generation.

    Parameters

    • generation: G

    Returns G

Generated using TypeDoc