/** * @fileoverview Browser-safe client-side computation of PoUW work units. * * Accepts an IWorkUnit payload, performs the requested SHA3-512 hash operation * (LeafHash or InteriorHash), and returns an IWorkResult with the computed * hash, timing metadata, and the original challenge token. * * Uses `@noble/hashes/sha3` directly for browser compatibility. * * @see Requirements 7.1, 7.2, 7.3, 7.4, 7.5 */ import { IWorkResult } from '../interfaces/pouw/workResult'; import { IWorkUnit } from '../interfaces/pouw/workUnit'; /** * Callback invoked to report computation progress. * * @param completed - Number of steps completed so far. * @param total - Total number of steps in this work unit. */ export type ProgressCallback = (completed: number, total: number) => void; /** * Compute a single PoUW work unit and return the result. * * For **LeafHash**: decodes the base64 `inputData`, computes SHA3-512, and * returns the 128-character lowercase hex digest. * * For **InteriorHash**: decodes the base64 `inputData` (concatenated child * hashes), computes SHA3-512 over the concatenation, and returns the hex * digest. * * @param workUnit - The work unit to compute. * @param onProgress - Optional callback for progress reporting. * @returns A promise resolving to the computed IWorkResult. * * @throws {TranslatableBrightChainError} if the operation type is unsupported * or the input data is not valid base64. * * @see Requirements 7.1, 7.2, 7.3, 7.4, 7.5 */ export declare function computeWorkUnit(workUnit: IWorkUnit, onProgress?: ProgressCallback): Promise; //# sourceMappingURL=computeWorkUnit.d.ts.map