cafe-utility 35.0.2 → 36.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +12 -3
  2. package/index.js +1553 -1551
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -712,14 +712,22 @@ export declare class Chunk {
712
712
  data: Uint8Array
713
713
  }
714
714
  }
715
+ export type ChunkEntry = {
716
+ chunk: Chunk
717
+ key?: Uint8Array
718
+ }
715
719
  export declare class ChunkSplitter {
716
- static readonly NOOP: (_: Chunk, _key?: Uint8Array) => Promise<void>
720
+ static readonly NOOP: (_: ChunkEntry[]) => Promise<ChunkEntry[]>
717
721
  private refSize
718
722
  private encrypted
723
+ private maxShards
719
724
  private chunks
720
725
  private counters
721
- private onChunk
722
- constructor(onChunk: (chunk: Chunk, key?: Uint8Array) => Promise<void>, encrypted?: boolean)
726
+ private pending
727
+ private onBatch
728
+ private onIntermediateChunk?
729
+ private hasParity
730
+ constructor(onBatch: (batch: ChunkEntry[]) => Promise<ChunkEntry[]>, maxShards?: number, encrypted?: boolean, onIntermediateChunk?: (chunk: Chunk, hasParity: boolean) => void)
723
731
  static root(data: Uint8Array): Promise<Chunk>
724
732
  static encryptedRoot(data: Uint8Array): Promise<{
725
733
  address: Uint8Array
@@ -727,6 +735,7 @@ export declare class ChunkSplitter {
727
735
  }>
728
736
  append(data: Uint8Array, level?: number, spanIncrement?: bigint): Promise<void>
729
737
  private elevate
738
+ private flushBatch
730
739
  finalize(level?: number): Promise<Chunk>
731
740
  }
732
741
  export declare class ChunkJoiner {