diff --git a/src/interface.ts b/src/interface.ts index 8b69ca7..d62927c 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -10,9 +10,22 @@ export interface Entry extends Tuple { } export interface Prefix { - readonly average: number; // same for all buckets of the same tree - readonly level: number; // changes based on level of the bucket in the tree, leaves are always level 0 - readonly base: number; // base number for delta encoding of entry seq field + /** + * Must be the same for all buckets of the same tree. + */ + readonly average: number; + + /** + * Changes based on the level of the bucket in the tree. + * Leaves are always level 0. + */ + readonly level: number; + + /** + * Base number for delta encoding. + * Set to boundary seq, 0 if the bucket is empty. + */ + readonly base: number; } export interface Bucket extends Prefix { @@ -20,7 +33,11 @@ export interface Bucket extends Prefix { getBytes(): Uint8Array; getCID(): CID; getDigest(): Uint8Array; - getBoundary(): Entry | null; // null if bucket is empty + + /** + * Null if the bucket is empty. + */ + getBoundary(): Entry | null; getParentEntry(): Entry | null; }