Skip to main content

Built and signed on GitHub Actions

Useful common types and utilities for implementing Willow protocols.

This package works with Bun, Cloudflare Workers, Node.js, Deno, Browsers
JSR Score
100%
Published
2 weeks ago (1.0.2)
v
ANY_SUBSPACE

Represents any subspace ID.

T
Area

A grouping of Entries.

f
areaIsIncluded

Return whether an area is fully included by another area.

T
AreaOfInterest

A grouping of Entries that are among the newest in some store.

f
areaTo3dRange

Convert an Area to a Range3d.

f
bigintToBytes

Encode a BigInt.

f
commonPrefix

Return the prefix shared by two Paths.

f
compactWidth

Returns the number of octets needed to store a number, along the lines of 8-bit, 16-bit, 32-bit, or 64-bit unsigned integers.

f
decodeAreaInArea

Decode an Area relative to a known outer Area.

f
decodeCompactWidth

Decode a variable width integer. Uses the bytelength of the passed encoding to determine the compact width.

f
decodeEntry

Decode bytes to an Entry.

f
decodePath

Decodes a path.

f
decodePathRelative

Decodes a Path relative to another Path.

f
decodeRange3dRelative

Decode an encoded Range3d relative to another Range3d.

f
decodeStreamAreaInArea

Decode an Area encoded relative to an outer Area from a GrowingBytes.

f
decodeStreamEntryInNamespaceArea

Decode an Entry relative to a namespace area from GrowingBytes.

f
decodeStreamEntryRelativeEntry

Decode an Entry encoded relative to another Entry from GrowingBytes.

f
decodeStreamEntryRelativeRange3d

Decode an Entry encoded relative to a Range3d from GrowingBytes.

f
decodeStreamPath

Decodes an encoded path (which is streaming in).

f
decodeStreamPathRelative

Decodes a Path relative to another Path from GrowingBytes.

f
decodeStreamRange3dRelative

Decode an Range3d relative to another Range3d from GrowingBytes.

f
decodeUintMax32

Decodes an UintMax unsigned integer,

f
defaultEntry
No documentation available
f
defaultRange3d

The open 3d range starting at a given default subspace ID.

f
encodeAreaInArea

Encode an Area relative to known outer Area.

f
encodeAreaInAreaLength

The length of an encoded area in area.

f
encodeCompactWidth

Encodes an integer using the smallest number of bytes possible.

f
encodedPathLength

Encodes the length of a Path.

f
encodedPathRelativeLength

Determine the bytelength of a Path encoded relative to another Path.

f
encodeEntry

Encode an Entry.

f
encodeEntryInNamespaceArea

Encode an Entry relative to an Area.

f
encodeEntryRelativeEntry

Encode an Entry relative to another Entry.

f
encodeEntryRelativeRange3d

Encode an Entry relative to an outer Range3d.

f
encodePath

Encodes a path.

f
encodePathRelative

Encodes a Path relative to another Path.

f
encodeRange3dRelative

Encode a Range3d relative to another Range3d.

f
encodeUintMax32

Encodes a number as a UintMax, with Max being the maximum number of octets needed to represent the unsigned integer

T
EncodingScheme

A scheme for encoding and decoding values of ValueType.

T
Entry

The metadata for storing a payload.

f
entryPosition

Returns the Position3d of an Entry.

f
fullArea

The full area is the Area including all Entries.

c
GrowingBytes

A bytestring which, upon request, pulls bytes from an asynchronous source of bytes.

f
intersectArea

Return the intersection of two areas, for which there may be none.

f
intersectRange

Returns the intersection of two ranges, of which there may be none.

f
intersectRange3d

Intersect two Range3d.

f
isEqualRangeValue

Compare a possible range value of ValueType or OPEN_END to another for equality.

f
isIncluded3d

Returns whether a Position3d is included by a given Range.

f
isIncludedArea

Return whether a 3d position is included by an Area.

f
isIncludedRange

Returns whether a Value is included by a given Range.

f
isPathPrefixed

Returns whether a path is prefixed by another path.

f
isSubspaceIncludedInArea

Return whether a subspace ID is included by an Area.

f
isValidPath

Returns whether a Path does not exceed the limits given by a PathScheme.

f
isValidRange

Returns whether the range's end is greater than its start.

f
isValidRange3d

Returns whether all a 3d range's constituent ranges are valid, i.e. correctly ordered.

T
KeypairEncodingScheme

A scheme for encoding public keys and the signatures they produce.

T
KeypairScheme

A scheme for signing with a keypair, and encoding the associated public keys and signatures.

f
max32Width

Returns the maximum number of octets needed to store an unsigned integer.

v
OPEN_END

Represents an open value for a range ending.

f
orderBytes

A total order over bytestrings.

f
orderPath

A total order over Path.

f
orderRangePair

Order a given pair of ranges by their type. Useful for functions using boolean logic based on the different combinations of range types.

f
orderTimestamp

A total order over BigInt.

T
Path

A Path is a sequence of bytestrings which Entrys are written to.

T
PathScheme

A set of limits for Paths.

T
Position3d

A position in a space with dimensions of time, path, and subspace.

f
prefixesOf

Return all prefixes of a given path (which included the path itself), in order of path length.

T
PrivyEncodingScheme
No documentation available
T
Range

A closed or open range of values.

T
Range3d

A three-dimensional with dimension of time, path, and subspace.

f
rangeIsIncluded

Returns whether a range is fully included by another range.

T
SignatureScheme

A scheme for signing and verifying data using key pairs.

T
StreamDecoder

A decoder for decoding values of ValueType from a GrowingBytes

f
subspaceArea

The subspace area is the Area include all entries with a given subspace ID.

f
successorBytesFixedWidth

Return the succeeding bytestring of the given bytestring without increasing that bytestring's length.

T
SuccessorFn

A function which returns the succeeding value for a given value of a set.

f
successorPath

Returns the successor to a path given a Path and PathScheme.

f
successorPrefix

Return a successor to a prefix, that is, the next element that is not a prefix of the given path.

T
TotalOrder

Defines a total order over a given set.