Class Box

Hierarchy (View Summary)

Properties

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

Accessors

Methods

  • checks to see if something is in the box

    Parameters

    Returns Promise<boolean>

    true if no value or container is in the box

  • 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>

  • Puts a value or a reference to another container in this box. If a bundler is supplied, the function will add the entry to that bundler and return immediately (presumably you know what to do with a CS if you passed it in). If the caller does not supply a bundler, then one is created on the fly, and then this method will await on the CS being added to the database instance. This is to allow simple console usage like: await myBox.put("some value");

    Parameters

    Returns Promise<Muid>

    a promise that resolves to the address of the newly created entry

  • checks to see how many things are in the box (will be either 0 or 1)

    Parameters

    • OptionalasOf: AsOf

      Historical time to look

    Returns Promise<number>

    0 or 1 depending on whether there's something in the box.

  • Generates a JSON representation of the data in the box (the box itself is transparent). 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! Prevent cycles from breaking things)

    Returns Promise<string>

    a JSON string