Class Sequence

Kind of like the Gink version of a Javascript Array; supports push, pop, shift. Doesn't support unshift because order is defined by insertion order.

Hierarchy (View Summary)

Properties

address: Muid
behavior: Behavior
database: Database
DELETION: Deletion = ...
globalPropertyMuid: { medallion: number; offset: Behavior; timestamp: number } = ...
INCLUSION: Inclusion = ...

Accessors

Methods

  • Function to iterate over the contents of the List, showing the address of each entry (which can be used in pop).

    Parameters

    • through: number = Infinity

      count of many things to iterate through, positive starting from front, negative for end

    • OptionalasOf: AsOf

      effective time to get the contents for

    Returns AsyncGenerator<[Muid, Value | Container], void>

    an async iterator across everything in the list, with values returned being pairs of Muid, (Value|Container),

  • Adds multiple entries into this sequence. NOTE: If you pass a bundler, all changes will share the same timestamp. This means you will not be able to move new entries in between these (you may move these entries between one another). Without a bundler, each item from the iterable will be committed separately, which will be costly, but there won't be the same restrictions on moving.

    Parameters

    • iterable: Iterable<Value | Container>

      An iterable of stuff to add to the sequence.

    • Optionalmeta: Meta

      optional place to pass in a comment or bundler

    Returns Promise<void>

  • Parameters

    • what: number | Muid
    • dest: number
    • Optionalpurge: boolean
    • Optionalmeta: Meta

    Returns Promise<void>

  • Reset this Container to a previous time. If no time is specified, the container will be cleared.

    Parameters

    • OptionaltoTime: AsOf
    • Optionalrecurse: any
    • Optionalmeta: Meta

    Returns Promise<void>

    toTime Optional time to reset to. If absent, the container will be cleared.

    recurse Recursively reset all child containers held by this container at reset time?

    meta Metadata to be used in the reset.

  • Reset the properties associated with this container to a previous time.

    Parameters

    • OptionaltoTime: AsOf

      optional timestamp to reset to. If not provided, the properties will be deleted.

    • Optionalmeta: Meta

    Returns Promise<void>

  • Dumps the contents of this list to a javascript array. useful for debugging and could also be used to export data by walking the tree

    Parameters

    • through: number = Infinity

      how many elements to get, positive starting from beginning, negative starting from end

    • OptionalasOf: AsOf

      effective time to get the dump for: leave undefined to get data as of the present

    Returns Promise<(Value | Container)[]>

    an array containing Values (e.g. numbers, strings) and Containers (e.g. other Lists, Boxes, Directories)

  • Generates a JSON representation of the data in the list. Mostly intended for demo/debug purposes.

    Parameters

    • indent: number | boolean = false

      true to pretty print

    • OptionalasOf: AsOf

      effective time

    • Optionalseen: Set<string>

      (internal use only! This prevents cycles from breaking things)

    Returns Promise<string>

    a JSON string