The type of the data stored in the box. This value will be encoded to bytes when stored and decoded on retrieval.
ReadonlyexistsGet a boolean indicating if the box exists or not
ReadonlykeyGet the key used by this box proxy
ReadonlylengthReturns the length of the box, or error if the box does not exist
Get or set the value stored in the box
Get will error if the box does not exist
Create the box for this proxy with a bzero value.
No op if the box already exists with the same size Errors if the box already exists with a different size. Errors if the specified size is greater than the max box size (32,768)
Optionaloptions: { size?: uint64 }True if the box was created, false if it already existed
Delete the box associated with this proxy if it exists.
True if the box existed and was deleted, else false
Get the value stored in the box if available, and a boolean indicating if the box exists.
If the box does not exist, the value returned at position 0 should not be relied on to have a valid value.
A tuple with the first item being the box value, and the second item being a boolean indicating if the box exists.
Resize the box to the specified size.
Adds zero bytes to the end if the new size is larger Removes end bytes if the new size is smaller Error if the box does not exist
The new size for the box
Splice the specified bytes into the box starting at start, removing length bytes
from the existing value and replacing them with value before appending the remainder of the original box value.
If the resulting byte value is larger than length, bytes will be trimmed from the end If the resulting byte value is smaller than length, zero bytes will be appended to the end Error if the box does not exist
Creates a Box proxy object offering methods of getting and setting the value stored in a single box.
Param: options
Options for creating the Box proxy